Re: [gtkmm] How can I obtain index of selection? (Gtk::Combo)



On Wed, 2004-09-29 at 05:33, Daniel J. Lauk wrote:
> Hi.
> 
> In case it is of interest to anybody: For the time being I use the following
> workaround:
> I keep a private std::map<Glib::ustring, int> and when I set up the combo box
> items I also feed each item and its index to the map.
> 
> The index then is available via a call to my_map[my_combo->get_entry()->get_text()].

You can also make a non-viewable column for the index, and set that as
you append items.  It's always retrievable from the selected row, and
you don't have to maintain a map.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]