[gtkada] how to get the window to which a menu is attached ?
Thomas De Contes
d.l.tDeContes at free.fr
Sun Nov 25 15:12:16 CET 2007
hi :-)
i don't find how to get the window to which a menu is attached,
although it's easy for a toolbar for example
mainWindow : Gtk_Window;
Menubar : Gtk_Menu_Bar;
Menu_Fichier : Gtk_Menu_Item;
Menufichier_Menu : Gtk_Menu;
Item_Nouv : Gtk_Image_Menu_Item;
Add (mainWindow, Menubar);
Append (Menubar, Menu_Fichier);
Set_Submenu (Menu_Fichier, Menufichier_Menu);
Append (Menufichier_Menu, Item_Nouv);
which Widget exactly is given by
Get_Toplevel(Item_Nouv) --> i expected Menufichier_Menu
Get_Parent(Get_Toplevel(Item_Nouv)) --> i expected Menu_Fichier
Get_Toplevel(Get_Parent(Get_Toplevel(Item_Nouv))) --> i expected
mainWindow
Get_Submenu(Item_Nouv) --> i expected Menu_Fichier
Get_Toplevel(Get_Submenu(Item_Nouv)) --> i expected mainWindow
Get_Parent(Item_Nouv) --> i expected Menufichier_Menu
Get_Submenu(Gtk_Menu_Item(Get_Parent(Item_Nouv))) --> i expected
Menu_Fichier
Get_Toplevel(Get_Submenu(Gtk_Menu_Item(Get_Parent(Item_Nouv)))) -->
i expected mainWindow
?
and then, how to get mainWindow from Item_Nouv ?
oops, the reverse of Set_Submenu is not Get_Submenu :-(
but there is one, isn't it ?
--
j'agis contre l'assistanat, je travaille dans une SCOP !
More information about the gtkada
mailing list