[wxPython-users] Binding with parameters?
Jarno Väyrynen
javayryn at mail.student.oulu.fi
Tue Jul 17 05:16:47 PDT 2007
Hi,
I'm fairly new with wxPython, and I have managed to bind a button press with an
event handler. What I cannot do is, I would like to pass a parameter to this
event handler, and I have no idea how to do it.
Here is my button and bind:
______________________________________________________________________________
self.createConditionActionSetButton = wx.Button(self.panel_left, label="Create
Condition - Action Set", pos=(0, 20), size=(200,20))
self.Bind(wx.EVT_BUTTON, self.OnCreateConditionActionSet,
self.createConditionActionSetButton)
And here the function:
def OnCreateConditionActionSet(self, evt, path):
logfile = open(path, 'r+')
print 'create c a set'
_______________________________________________________________________________
So I have another function that creates and saves a file and returns this
"path", and I should somehow be able to pass this "path" further to the other
function "OnCreateConditionActionSet", which is called by pressing equivalent
button.
Thanks for any help,
Jarno
More information about the wxpython-users
mailing list