Hi,

I apologize for asking a silly question here, but I just can't figure it out by myself. I am creating a submenu of a main menu of a gnome program. I would like to add accelerators to the menu items of my menu.

       gomenu = gtk.Menu()
       back = gtk.ImageMenuItem(gtk.STOCK_GO_BACK)
       back.connect("activate",self.back_clicked)
       back.show()
       gomenu.append(self.back)

The above snippet works. But when I attempt to add an accelerator using
back.add_accelerator()
is when I get in trouble. The add_accelerator() method of gtk.Widget wants accel_group as its second argument. What am I supposed to give it?

I tried None (does not work) and an empty gtk.AccelGroup() (works but produces complains about not being able to connect to the accel group). I also tried obtaining the get_accel_group() of the present menu, which returns None. I probably should add here that the whole menu hierarchy was created in glade and parsed using libglade. I want to just create this little submenu from the python code.

Any help is greatly appreciated.

Alex

--
Alexander Roitman   http://ebner.neuroscience.umn.edu/people/alex.html
Dept. of Neuroscience, Lions Research Building
2001 6th Street SE, Minneapolis, MN  55455
Tel (612) 625-7566   FAX (612) 626-9201

Attachment: pgp00000.pgp
Description: PGP signature

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to