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:
parent
b2c5ad96cb
commit
63ee87fa16
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue