Re: question on gtk_menu_item_set_submenu



On Sat, 18 Sep 2004, Maciej Katafiasz wrote:

Dnia 17-09-2004, pi o godzinie 17:24 -0400, Allin Cottrell napisaB(a):
I'm using gtk_menu_item_set_submenu to attach a little submenu to a
certain item in a popup menu.  So far so good, but I'd like the same
submenu to appear "beneath" more than one item in the primary popup
menu.  When I call gtk_menu_item_set_submenu for a second time, with a
different attachment-point parameter but the same submenu parameter, I
see this at runtime:

Gtk-WARNING **: gtk_menu_attach_to_widget(): menu
already attached to GtkMenuItem

Is this bad?  Should I be doing this in a different way?
(gtk version is 2.4.9)

in gtk-demo app (comes with gtk+ source distribution, in Debian it's in
gtk2.0-examples package, dunno for other distros), there's menu example
which does just that...

Thanks for pointing that out. Looking at the demo code, I see that the recursive nature of the submenu creation means that a distinct submenu gets created each time (I think). I've now modified my code to create distinct copies of the submenu, and the warning has disappeared.

Allin Cottrell



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