如何从Mac OS X Dock隐藏应用程序图标 [英] How to hide application icon from Mac OS X dock

查看:433
本文介绍了如何从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

这篇关于如何从Mac OS X Dock隐藏应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆