如何从Mac OS X Dock隐藏应用程序图标
我有一个wxpython脚本,它创建一个wx.App
和一个框架,将其隐藏并使用隐藏的框架进行一些处理.我不希望该脚本的图标出现在Mac Dock中,但是它确实来了.那么如何隐藏它,我在wxPython中找不到任何东西,所以那里有一些我可以调用的Carbon API?
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?
最简单的python脚本使图标出现
Simplest python script makes icon to appear
>>> import wx
>>> app = wx.App()
我无法找到以编程方式隐藏应用程序图标的方法,唯一的方法似乎是在Info.plist中设置LSUIElement=1
,因此该应用程序需要根据用户选项打开和关闭图标,可能必须有两个应用程序使用符号链接共享所有代码,但info.plist文件除外,这对于不同模式的应用程序将有所不同.
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-vers-the-right-way-to-do