After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 492943 - Calling gtk_widget_add_accelerator on GtkMenuItem leads to '-/-' suffix on label
Calling gtk_widget_add_accelerator on GtkMenuItem leads to '-/-' suffix on label
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.12.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-11-03 07:32 UTC by Robert Ancell
Modified: 2009-08-07 21:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Robert Ancell 2007-11-03 07:32:59 UTC
Calling gtk_widget_add_accelerator() on a GtkMenuItem causes a '-/-' to be appended to the menu item label.

OS: Ubuntu Gutsy (libgtk2.0 2.12.0)
Occurs: Always
Expected behaviour: Appropriate text appended to label (e.g. Ctrl-0) or nothing appending to label.

Example program in PyGtk (expand window to see error, also works in C library):
---
import gtk
import gtk.gdk

window = gtk.Window()
item = gtk.MenuItem('GtkMenuItem')
accelGroup = gtk.AccelGroup()
item.add_accelerator('activate', accelGroup, ord('0'), gtk.gdk.CONTROL_MASK, 0)
window.add(item)
window.show_all()

gtk.main()
---

The label shows 'GtkMenuItem -/-'. I would expect it to be 'GtkMenuItem Ctrl-0'