GNOME Bugzilla – Bug 533567
gtk-builder-convert crashes: UnbouldLocalError from GtkImageMenuItem
Last modified: 2008-05-17 14:20:20 UTC
Steps to reproduce: 1. Create a New Project in Glade 3.x 2. Drop the default GtkMenuBar into a GtkWindow. 3. Run through gtk-builder-convert Stack trace: The default GtkImageMenuItem's in glade are "stock" menus which output a "use_stock" property such as following: <widget class="GtkImageMenuItem" id="new_menu_item"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="label" translatable="yes">_New</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <signal name="activate" handler="on_new_menu_item_activate"/> </widget> When you try to run this through gtk-builder-convert you get the following error: Traceback (most recent call last):
+ Trace 197957
sys.exit(main(sys.argv))
conv.parse_file(input_filename)
self._parse()
self._convert(node.getAttribute("class"), node)
self._convert_menu(node)
item = self._convert_menuitem(uimgr, obj_node)
self._add_action_from_menuitem(uimgr, obj_node)
properties['stock_id'] = child
This can be worked around by changing all default GtkImageMenuItem's in glade to "Stock" = 'None' and instead set the "Label" manually and apply a stock image under 'Internal Image Properties'. That results in the following: <widget class="GtkImageMenuItem" id="new_menu_item"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="label" translatable="yes">_New</property> <property name="use_underline">True</property> <signal name="activate" handler="on_new_menu_item_activate"/> <child internal-child="image"> <widget class="GtkImage" id="menu-item-image1"> <property name="stock">gtk-new</property> </widget> </child> </widget> Other information: Confirmed on Ubuntu "Gutsy" and "Hardy", GTK+ 2.12.9, Glade 3.x
Created attachment 111045 [details] Screenshot of Glade Menu Editor which causes crash
Created attachment 111046 [details] Screenshot of Glade Menu Editor as work-around
*** This bug has been marked as a duplicate of 523932 ***
Oops, sorry. I don't know why I didn't see that duplicate.