[gtkmm] Associating data with Treeview or ComboBox items.



Hi,

In Mikro$haft Windows you can store data with every item in a list or a dropdown list box which can be simply a number or a pointer to an object. This is quite nice since it makes it quite easy to retrieve the object associated with each list item. The advantage of this over having an array (or vector) of object pointers with the same order as the list items, is that with an array of pointers you must reorder the array every time a user reorders or sorts the list.

Is there any way to do this with a treeview or combobox?

Please forgive my bonehead questions, I'm trying to learn gtkmm and the stl at the same time. When I programmed for Windows using MFC the stl was not mature or complete at first and MFC provided alternatives or I wrote my own (double-linked template-based list etc.)

Thanks,
Moses




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