Thread: KeepNote
View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#8
Originally Posted by BrentDC View Post
BTW, how hard could it be to reparent the menu?
In this case, reparenting isn't required. The gtk.ItemFactory it uses allows us to get a gtk.Menu instead of a gtk.MenuBar.

This works to get an Hildon menu:
Code:
--- main_window.py	2009-04-12 16:36:50.000000000 +0100
+++ main_window.py.hildonmenu	2009-04-17 16:16:18.000000000 +0100
@@ -22,6 +22,7 @@
 import pygtk
 pygtk.require('2.0')
 from gtk import gdk
+import hildon
 import gtk.glade
 import gobject
 import pango
@@ -218,7 +219,7 @@
 
 
 
-class KeepNoteWindow (gtk.Window):
+class KeepNoteWindow (hildon.Window):
     """Main windows for KeepNote"""
 
     def __init__(self, app):
@@ -327,7 +328,7 @@
         # menu bar
         main_vbox.set_border_width(0)
         self.menubar = self.make_menubar()
-        main_vbox.pack_start(self.menubar, False, True, 0)
+	self.set_menu(self.menubar)
         
         # toolbar
         main_vbox.pack_start(self.make_toolbar(), False, True, 0)          
@@ -1813,7 +1814,7 @@
                 
 
         # Create item factory
-        self.item_factory = gtk.ItemFactory(gtk.MenuBar, "<main>",
+        self.item_factory = gtk.ItemFactory(gtk.Menu, "<main>",
                                             self.accel_group)
         self.item_factory.create_items(self.menu_items)
         self.add_accel_group(self.accel_group)
 

The Following 2 Users Say Thank You to qwerty12 For This Useful Post: