close minimises to tray

In regards to this question here, http://groups.google.com/group/
wxpython-mac/browse_thread/thread/6e50401523c38903?pli=1
does anyone know if this is still the case?

Currently the app is in the dock rather than the system tray, but I have
a problem where I want the app to minimise and stay running when
the app is closed (from the x in the app) and quit entirely when Quit is
selected from the dock right click context menu. As Quit is there by
default in the context menu I can't control what it does and I can't tell
the difference in my app from closing from 'x' on my app. So I'm not
sure how to make this work.

Ah, I found I can tell the difference between the close events with
event.CanVeto()

Paul <poalman <at> gmail.com> writes:

In regards to this question here, http://groups.google.com/group/
wxpython-mac/browse_thread/thread/6e50401523c38903?pli=1
does anyone know if this is still the case?

Currently the app is in the dock rather than the system tray, but I have
a problem where I want the app to minimise and stay running when
the app is closed (from the x in the app) and quit entirely when Quit is
selected from the dock right click context menu. As Quit is there by
default in the context menu I can't control what it does and I can't tell
the difference in my app from closing from 'x' on my app. So I'm not
sure how to make this work.

Also, I can't seem to get anything to bind to EVT_TASKBAR_LEFT_UP. I have tried
self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnActivate) on the frame and a subclass
of wx.TaskBarIcon. I've also tried wx.EVT_TASKBAR_LEFT_UP(self,self.OnActivate)
in both places but the events never fired, I also Tried LEFT_DOWN and CLICK

(CLICK binds to the right click and hangs the application for a second? This is a
bit weird but might be a clue)

Paul<poalman<at> gmail.com> writes:

In regards to this question here, http://groups.google.com/group/
wxpython-mac/browse_thread/thread/6e50401523c38903?pli=1
does anyone know if this is still the case?

In 2.9 the menu bar is used by default for wx.TaskBarIcon, and you need to specify a flag to have it be in the Dock.

Currently the app is in the dock rather than the system tray, but I have
a problem where I want the app to minimise and stay running when
the app is closed (from the x in the app) and quit entirely when Quit is
selected from the dock right click context menu. As Quit is there by
default in the context menu I can't control what it does and I can't tell
the difference in my app from closing from 'x' on my app. So I'm not
sure how to make this work.

Also, I can't seem to get anything to bind to EVT_TASKBAR_LEFT_UP. I have tried
self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnActivate) on the frame and a subclass
of wx.TaskBarIcon. I've also tried wx.EVT_TASKBAR_LEFT_UP(self,self.OnActivate)
in both places but the events never fired, I also Tried LEFT_DOWN and CLICK

(CLICK binds to the right click and hangs the application for a second? This is a
bit weird but might be a clue)

IIRC the wwxTaskBarIcon on Mac is not able to respond to all events because of the nature of the Dock and the other functionality already there. (Raising and cycling application windows, being a drop target for documents, etc.) I don't remember for sure but I think that we're limited to just setting the icon and adding items to the menu.

···

On 11/14/11 8:17 AM, Paul wrote:

--
Robin Dunn
Software Craftsman