24 lines
435 B
Python
24 lines
435 B
Python
# Bryan Schumaker
|
|
|
|
import ocarina
|
|
|
|
gtk = ocarina.gtk
|
|
Menu = gtk.Menu
|
|
MenuItem = gtk.MenuItem
|
|
|
|
lib_items = []
|
|
|
|
def add_lib_menu_item(text, func):
|
|
lib_items.append( (text, func) )
|
|
lib_items.sort()
|
|
|
|
|
|
def make_lib_menu(button, time):
|
|
menu = Menu()
|
|
for (text, func) in lib_items:
|
|
item = MenuItem(text)
|
|
item.connect("activate", lambda x: func())
|
|
item.show()
|
|
menu.append(item)
|
|
menu.popup(None, None, None, button, time)
|