如何从 Mac OS X Dock 隐藏应用程序图标
我有一个 wxpython 脚本,它创建一个 wx.App
和一个框架,隐藏它并使用隐藏框架进行一些处理。我不希望此脚本的图标出现在 Mac Dock 中,但它确实出现了。那么我怎样才能隐藏它呢,我在 wxPython 中没有找到任何东西,所以它有一些我可以调用的碳 API?
最简单的Python脚本使图标出现
>>> import wx
>>> app = wx.App()
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()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我无法找到以编程方式隐藏应用程序图标的方法,唯一的方法似乎是在 Info.plist 中设置
LSUIElement=1
,因此需要根据用户打开和关闭图标的应用程序选项可能必须有两个应用程序,它们使用符号链接共享所有代码,但 info.plist 文件除外,不同模式的应用程序会有所不同。无论如何,这更好地解释了
http: //codesorcery.net/2008/02/06/feature-requests-versus-the-right-way-to-do-it
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
在加载您的应用程序之前使用此 AppKit 代码:
Using this AppKit code before load your app: