A question about wx.TaskBarIcon's event

Hi Guys,

I have deal with two wx.TaskBarIcon’s events: wx.EVT_TASKBAR_LEFT_DCLICK and wx.EVT_TASKBAR_LEFT_UP

self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)

self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarShowState)

def OnTaskBarShowState(self,evt):

frame = stateframe((200,200))

frame.Show()

def OnTaskBarActivate(self,evt):

if self.state == True:

pass

else:

self.frame.Show()

self.state=True

And my question is when I Double clicked the Icon in the system tray, the wx.EVT_TASKBAR_LEFT_UP function is also be called.

How can I fix it, I want if I Double clicked the icnon, it only call OnTaskBarShowState.

Thanks

Seeing as a left double click has two left up events built-in, this is
entirely normal. If you don't want that behavior, than don't bind to
two left mouse button events. Make one of them a middle or right click
event instead.

···

On Sep 17, 8:22 am, "usr.root" <usr.r...@gmail.com> wrote:

Hi Guys,

I have deal with two wx.TaskBarIcon's events: wx.EVT_TASKBAR_LEFT_DCLICK and wx.EVT_TASKBAR_LEFT_UP
self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarActivate)
self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarShowState)

def OnTaskBarShowState(self,evt):
frame = stateframe((200,200))
frame.Show()

def OnTaskBarActivate(self,evt):
if self.state == True:
pass
else:
self.frame.Show()
self.state=True

And my question is when I Double clicked the Icon in the system tray, the wx.EVT_TASKBAR_LEFT_UP function is also be called.
How can I fix it, I want if I Double clicked the icnon, it only call OnTaskBarShowState.

Thanks

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org