Commits

Henrik Stuart committed f9d7659

gtklib: be better backward compatible

Now works with Ubuntu Jaunty again

Closes #1095

  • Participants
  • Parent commits 4f989b2
  • Branches stable

Comments (0)

Files changed (1)

tortoisehg/hgtk/gtklib.py

        label = label.replace('_', '__')
     if kargs.get('asradio') or kargs.get('ascheck'):
         if kargs.get('asradio'):
-            menu = gtk.RadioMenuItem(kargs.get('group'), label)
+            menu = gtk.RadioMenuItem(kargs.get('group'), label, use_underline=use_underline)
         else:
-            menu = gtk.CheckMenuItem(label)
+            menu = gtk.CheckMenuItem(label, use_underline=use_underline)
         menu.set_active(kargs.get('check', False))
     elif icon:
         menu = gtk.ImageMenuItem(label)
         menu.set_image(get_icon_image(icon))
     else:
-        menu = gtk.MenuItem(label)
+        menu = gtk.MenuItem(label, use_underline=use_underline)
     if handler:
         args = kargs.get('args', [])
         menu.connect('activate', handler, *args)
     menu.set_sensitive(kargs.get('sensitive', True))
-    if gtk.gtk_version >= (2, 14, 0):
-       menu.set_use_underline(use_underline)
     menu.set_border_width(1)
     return menu