Search code examples
macoswxpythonmacos-carbon

How to hide application icon from Mac OS X dock


I have a wxpython script, which creates a wx.App and a frame, hides it and does some processing using hidden frame. I do not want this script's icon to appear in Mac dock but it comes. So how can i hide it, I did not find anything in wxPython so it there some carbon API which I can call?

Simplest python script makes icon to appear

>>> import wx
>>> app = wx.App()

Solution

  • I was not able to find a way to hide app icon programmatically, only way seems to be to set LSUIElement=1 in Info.plist, so the apps which need to switch on and off icon depending on user option may have to have two app which share all the code using symbolic links except the info.plist files which will be different for different mode app.

    Anyway this explains it better

    http://codesorcery.net/2008/02/06/feature-requests-versus-the-right-way-to-do-it