Skip to content

Instantly share code, notes, and snippets.

@driscollis
Created March 31, 2015 17:06
Show Gist options
  • Save driscollis/87219b9756bce898e374 to your computer and use it in GitHub Desktop.
Save driscollis/87219b9756bce898e374 to your computer and use it in GitHub Desktop.
import wx
########################################################################
class MyPanel(wx.Panel):
""""""
#----------------------------------------------------------------------
def __init__(self, parent):
"""Constructor"""
wx.Panel.__init__(self, parent)
arg_one = 5
arg_two = 10
btn = wx.Button(self, label="My Button")
func = lambda evt: self.my_function(evt, arg_one, arg_two)
btn.Bind(wx.EVT_BUTTON, func)
#----------------------------------------------------------------------
def my_function(self, evt, x, y):
""""""
print x + y
########################################################################
class MyFrame(wx.Frame):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
wx.Frame.__init__(self, None, title="IDs")
panel = MyPanel(self)
self.Show()
if __name__ == "__main__":
app = wx.App(False)
frame = MyFrame()
app.MainLoop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment