Boost logo

Boost :

From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2007-03-28 12:22:40


On 3/28/07, Steven Watanabe <steven_at_[hidden]> wrote:
>
> Here is how I would do it:
>
> quantity<SI::length> on_dialog_ok()
> {
> double conversion = combo.selected_item().data();
> double value = entry.value().as_double();
> return quantity<SI::length>::from_value(conversion * value);
> }

There may be some confusion (again) on my part as to what
combo.selected_item.data() is returning, and how it's useful to the
quantity directly. I was assuming from Noah's post that it was either
the integer of the currently selected item in the combo box, or the
string of the currently selected item in the combo box. I can see how
both of those could be immediately useful to the run-time quantity.
It would either know that the number, say 5, mapped to feet, or it
would be passed "feet".

What does your version do exactly? What is
combo.selected_item().data() returning, why is it a double, and how
does from_value use it?

--Michael Fawcett


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk