ocarina/trunk/src/GuiObjects/menuItem.py
bjschuma 920ce35570 buttons, images, checkboxes, scrolling to current track,toggling random
git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@36 1daee41c-8060-4895-b1f0-2197c00d777a
2009-06-29 03:13:12 +00:00

22 lines
411 B
Python

import pygtk
pygtk.require('2.0')
import gtk
class MenuItem(gtk.MenuItem):
#
def __init__(self,lbl,func,text,data,subs):
gtk.MenuItem.__init__(self,label=lbl)
if func != None:
self.connect("activate",func,text,data)
# If there are any submenus, add them
if subs != None:
menu = gtk.Menu()
for sub in subs:
menu.append(sub)
self.set_submenu(menu)
# Show the menu
self.show()