PDA

View Full Version : Mac application and the Dock Icon



sekelsenmat
19th September 2007, 10:28
Hi,

I am writing a Mac application with Qt, which creates a system tray icon, and the user can configure everything from there. So there is no need for the Dock icon. How can I disable it?

Also, I noticed that when I right click my Dock icon, I see some options, including quit software, but then I click this one. Nothing happens. Also, the Dock icon has a default icon.

If I were to use a Dock icon in this software (something I am considering), how would I control what to do when the user clicks the context menu?

How can I add new items to the Dock context menu?

and finally, how can I change the icon on the Dock?

I searched qt docs, but haven't found much about this.

Thank you very much,

wysota
19th September 2007, 12:02
Have a look at this: http://doc.trolltech.com/qq/qq18-macfeatures.html
There is a section about implementing dock menus there.

sekelsenmat
26th September 2007, 10:07
Hi,

I used qt_mac_set_dock_menu but that adds new items to the Dock context menu, it doesn't make the already existing items (automatically added by Mac OS X) start working.

There are about 5 standard items added by Mac OS: Quit, Hide, Show in Finder, Open at startup and Remove from Dock

The last four seam to be automatically handled by the OS, but my problem is that when the user presses "Quit", the application doesn't quit, althougth I think it would be nice if it would.

Any ideas how to make the Quit button on the Dock work?

thanks,

wysota
26th September 2007, 11:23
You probably have to reimplement some event handler and handle it there. But you have to dive into the docs (both Qt and Carbon/whatever) to see what the event is.