Thanks all!
Using wx.CallAfter(self.Cleanup) and destroying icon there helped.
I am just curious why the behaviour changed. My approach worked over a
few wxPython versions before.
···
--
Fenikso
On 18 srp, 18:07, Robin Dunn <ro...@alldunn.com> wrote:
On 8/17/10 12:57 PM, WinCrazy wrote:
> Apparently my demo is a bit MSW-centric. Deleting the icon object
> seems
> to make the code more platform independent.> Robin,
> in your [ def OnTaskBarClose() ] what is the purpose of:> wx.CallAfter( self.Close )
> It doesn't seem to be necessary on MSW (is it ?). Why is a separate
> wx.TaskBarIcon event handler needed at all ? Why not just let
> OnFrameClose()
> do all the necessary icon object deleting and app closing ?It is about separating the closing of the frame from the taskbar icon.
In essence the taskbar icon is merely asking the frame to close itself,
and then waiting for the frame to do the clean up work, including the
destruction of the taskbar icon. I usually do it this way because there
have been some problems in the past if the taskbar icon is destroyed
while it is actively processing one of its event handlers.--
Robin Dunn
Software Craftsmanhttp://wxPython.org