[gtkmm] Combo: showing strings, but returning int's.



Hi there,
I'm working on a program that displays data from a database.
In many of the db-tables, there is one field with the id-number followed by
fields with the data wich is usually strings.

I'm displaying these strings in a combo and trying to have it return the
id-number belonging to the selected string on selection.

I've tried using:
Gtk::ComboDropDownItem* item = Gtk::manage(new Gtk::ComboDropDownItem);

..but that seems to enable one to add more than one widget to the combo-items,
and that's not what I'm trying to do. I thougt maybe I could add two labels to
each of the combo-items, and have only one of them displayed and the other one
read on selection so I could return it, but haven't figured out how to do
this. Maybe this is not the way to do it..?

Anyone got a suggestion on how to do this in an easy way?

--
Lars-Rune Nøstdal,
Norway




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