Re: menu doesn't have ancestor?



Pedro Zorzenon Neto <pzn terra com br> writes:
> 
>   When I do:
>   
>   anc = gtk_widget_get_ancestor (button1, GTK_TYPE_WINDOW);
> 
>   inside a button1 callback, it returns a pointer to the ancestor window.
> 
>   But if I do it inside a menu item callback (changing button1 to menuitem1)
>   it doesn't work.
> 
>   Any hints?

GtkMenu is a toplevel, so the menu items are not inside a GtkWindow.

Easiest thing is to set the GtkWindow on the menu items with
gtk_object_set_data().

Havoc




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