[gtkmm] Warning with OptionMenu



Hi,

 I'm trying here first because I don't understand the bug (if it's one)
 and the code I have uses gtkmm 1.3.17 (not CVS).  In the course of
 writing a new application with glademm (current CVS), I found it
 generates something like this (stripped down):

window1_glade::window1_glade() : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
{
   Gtk::Window *window1 = this;
   Gtk::Menu *menu1 = manage(new class Gtk::Menu());
   Gtk::OptionMenu *optionmenu1 = manage(new class Gtk::OptionMenu());
   menu1->items().push_back(Gtk::Menu_Helpers::MenuElem("Foo"));
   optionmenu1->set_flags(Gtk::CAN_FOCUS);
   optionmenu1->add(*menu1);
   window1->add(*optionmenu1);
   menu1->show();
   optionmenu1->show();
   window1->show();
}

 when ran, it produces the following warning:

(foo:13487): Gtk-WARNING **: Attempting to add a widget with type
gtkmm__GtkMenu to a container of type gtkmm__GtkOptionMenu, but the
widget is already inside a container of type GtkWindow, the GTK+ FAQ at
http://www.gtk.org/faq/ explains how to reparent a widget.

 (That URL comes out empty.)  The OptionMenu is empty and when clicked
 it produces:

(foo:13493): Gtk-CRITICAL **: file gtkmenu.c: line 647 (gtk_menu_popup): assertion `GTK_IS_MENU (menu)' failed

(foo:13493): Gtk-CRITICAL **: file gtkmenu.c: line 868 (gtk_menu_get_active): assertion `GTK_IS_MENU (menu)' failed

 GTK+ is 2.0.5 and gtkmm has been compiled with gcc 2.95.4 if that
 matters.

 Thanks,

-- 
Marcelo



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