It's rumoured that Andreas Pflug once said:
> I got a serious problem with GTK, and I have no clue how to handle it.
> The problem is about menus.
>
> When changing the nodes in the tree, the context menu and the Edit menu
> will be changed; the New menu entry will reflect the current node's
> abilities. My first implementation destroyed the "New Object" menu item
> including its submenu, and appended it freshly according to the node.
> This lead this message on every node change:
> tk-WARNING **: gtk_menu_attach_to_widget(): menu already attached to
> GtkMenuItem
> Gtk-CRITICAL **: file gtkwidget.c: line 1388 (gtk_widget_destroy):
> assertion `GTK_IS_WIDGET (widget)' failed.
>
> Then I changed the coding. Now, I only delete all menu items from the
> "New Object" submenu, and append new items as appropriate. The
> mentioned debug messages disappeared.
> Still, the application will end with the message
Hi Andreas,
Not sure about the error itself, but rather than altering menus
dynamically, please enable/disable options. It makes the program much
easier for people to learn because they will see where options are whether
or not they can actually use them at that point, rather than seeing an
ever-changing menu which can leave people thinking 'I know I saw that
option, but darned if I can find it now'.
Regards, Dave.