Menu direct function call

Menu callback functions should not go through a lambda layer.  Instead,
call the given function directly.
This commit is contained in:
Bryan Schumaker 2010-10-30 13:51:48 -04:00
parent b2c5ad96cb
commit 63ee87fa16
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class Collection(gtk.ScrolledWindow):
list.set_value(list_iter, len(list_row)-1,
"Played: %s Score: %s" % items)
def add_selected_to_playlist(self):
def add_selected_to_playlist(self, *args):
self.list.for_each_selected(collection.plist_add_libid)
collection.plist_save()
collection.plist_refresh()

View File

@ -24,7 +24,7 @@ def make_menu(items, button, time):
menu = Menu()
for (text, func) in items:
item = MenuItem(text)
item.connect("activate", lambda x: func())
item.connect("activate", func)
item.show()
menu.append(item)
menu.popup(None, None, None, button, time)