Re: gtk_option_menu_set_menu



Yes I know but I don't want to add a GDK_TYPE_PIXBUF, G_TYPE_STRING,
G_TYPE_INT, G_TYPE_TOGGLE, etc with a renderer (pixbuf, text or toggle).

I want to add a widget (menu) so more something like that :

GtkWidget *combo;
GtkTreeIter iter;
GtkListStore *store;
GtkWidget *menu;
GtkWidget *item;

store = gtk_list_store_new (1, G_TYPE_OBJECT);
combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));

/* Menu for the first row */
menu = gtk_menu_new ();

item = gtk_menu_item_new_with_label ("Item 1");
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);

item = gtk_menu_item_new_with_label ("Item 2");
gtk_menu_shell_append (GTK_MENU_SHELL(menu), item);

/* First row */
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter, 0, menu,  -1);

/* N rows ... */
with other menus 

John, I send to you my tiny image (2 k).

Regards,

Stephane

Le dim 10/10/2004 à 16:20, John Cupitt a écrit :
There's a section in the API reference about this:

http://developer.gnome.org/doc/API/2.0/gtk/gtk-migrating-GtkComboBox.html

On Sun, 10 Oct 2004 14:00:12 +0200, Stephane Raimbault
<stephane raimbault free fr> wrote:
I'm porting my GTK code to GTK+ 2.4 (with deprecated flags) but I don't
know how to replace gtk_option_menu_set_menu (GTK reference guide just
says : deprecated).


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