From 63ee87fa16805767c43bfdfc0f0e2c3e46a19cbe Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 30 Oct 2010 13:51:48 -0400 Subject: [PATCH] Menu direct function call Menu callback functions should not go through a lambda layer. Instead, call the given function directly. --- ocarina/collection.py | 2 +- ocarina/menu.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ocarina/collection.py b/ocarina/collection.py index bd792096..7203f8a2 100644 --- a/ocarina/collection.py +++ b/ocarina/collection.py @@ -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() diff --git a/ocarina/menu.py b/ocarina/menu.py index 5d86afc4..d5f13e7b 100644 --- a/ocarina/menu.py +++ b/ocarina/menu.py @@ -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)