Re: [gtk-list] Re: getting the optionmenu text in gtk--



Havoc Pennington <rhpennin@midway.uchicago.edu> writes:

> The best way is probably to do 
> 
> /* pointer_to_data is a pointer to your string */
> gtk_object_set_data(GTK_OBJECT(menuitem), "my_data_key",
>                     pointer_to_data);

More like :

 menuitem->set_data("my_data_key", pointer_to_data);

> gchar* text_of_item = (gchar*)gtk_object_get_data(GTK_OBJECT(menuitem),
>                                                   "my_data_key");

or:

 gchar* text_of_item = menuitem->get_data("my_data_key", pointer_to_data);

since this is Gtk-- after all :-)

-- 
					Guillaume.
					http://www.worldnet.fr/~glaurent



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