[gtkada] how to get the window to which a menu is attached ?
Thomas De Contes
d.l.tDeContes at free.fr
Mon Nov 26 19:46:18 CET 2007
Le 26 nov. 07 à 14:39, <Scott.Loyd at gtri.gatech.edu>
<Scott.Loyd at gtri.gatech.edu> a écrit :
> Thomas,
>
> For menus, you must go through the attach widget. Something like
> this -
>
> procedure On_Activate (Menu_Item : access
> Gtk_Menu_Item_Record'Class) is
> Toplevel : Gtk_Window;
> Parent,Other : Gtk_Widget;
> begin
> Parent := Get_Parent(Menu_Item);
> Other := Get_Attach_Widget(Gtk_Menu(Parent));
> Toplevel := Gtk_Window(Get_Toplevel(other));
> ...
so the reverse for Set_Submenu is Get_Attach_Widget
it works :-)
thank you really very much :-))
> As for your synchronization problem, I have tried similar things in
> the past to synchronize and found the best way to do this was to
> use the "focus_out_event" signal. Nothing happens until the
> Gtk_Gentry box loses focus, but I think this is the cleanest way to
> do what you want to do.
thank you :-)
if i have threads, and then one of them wants to display a dialog
while the user is typing some text in the entry,
can we be sure that focus_out_event will be send when the dialog will
be displayed ?
in fact, can we be sure that focus_out_event will be send when it
happens anything outside the entry, not only when the user clicks on
an other entry ?
--
j'agis contre l'assistanat, je travaille dans une SCOP !
More information about the gtkada
mailing list