Re: attaching a callback that updates combo_box entries



To be more specific, I need something like

GValue *gtk_list_store_get_cell_value(store,&iter,column);

gtk_list_store_set*() has simply too many parameter to be usable from callbacks.
I am open for any arguments proving me wrong ;)

Stefan

Stefan Kost wrote:
hi hi,

I've updated my code to use gtk_combox_box instead of option_menu. Yes, I've
read the little migration guide in the gtk+ api docs.

I must say that as soon as it gets a little dynamic gtk_combox_box_new_text() is
fairly useless. No way to rename items, re-populate the list etc.

So I've chosen the hard way using an ListStore.

In the old version I attached callbacks to each menu-items label, that where
triggered by notify::id of the underlying object. mean when the objects id
changed the menu changed as well.
Now with the ComboBox I would need to change the text in the model, like
gtk_list_store_set(store,&iter,0,new_id,-1);

now the big question is what can I pass to user_data of the callback that I can
use to get store and iter from. Don't tell me I should use a struct. In that
case the design is broken - I wouldn't accept that in my code.

Can't I get the label thats behind the cell?

Stefan


------------------------------------------------------------------------

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

-- 
      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 301166
|      ///           04277 Leipzig      04251 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
|           WWW      www.sonicpulse.de  www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - -  -    -


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