def __init__(self): wx.Frame.__init__(self, None, title="TaskBarIcon Tutorial", size=(500,500)) panel = wx.Panel(self) self.tbIcon = PythonIcon(self) self.Bind(wx.EVT_CLOSE, self.onClose)