From 9f7ee741899741e39565a5545bdcf839575ea513 Mon Sep 17 00:00:00 2001 From: tangstad Date: Thu, 4 May 2006 15:32:59 +0000 Subject: [PATCH] Replaced function as button-attribute with lambda as button click handler. --- system/workflow.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/system/workflow.py b/system/workflow.py index d406007..1c620f6 100644 --- a/system/workflow.py +++ b/system/workflow.py @@ -145,8 +145,8 @@ class WorkflowView (gtk.VBox): # Add functions in each stage for fun in stage.functions: btn = gtk.Button(fun.name) - btn.connect('clicked', self.button_click_handler) - btn.function = fun + btn.connect('clicked', + lambda button, f=fun : self.run_function(f)) btn_box.add(btn) btn.show() @@ -190,7 +190,4 @@ class WorkflowView (gtk.VBox): project.add_data(parent_data, new_data, function.name) logger.log('debug', 'Function ended: %s' % function.name) - - def button_click_handler(self, button): - self.run_function(function = button.function)