简体   繁体   English

Python中的NSStatusItem

[英]NSStatusItem in Python

Is there any way to create a menubar app in python (The obj-c equivalent appears to be NSStatusItem) using either wxPython or Tkinter? 有什么方法可以使用wxPython或Tkinter在python中创建菜单栏应用程序(等效于obj-c的是NSStatusItem)? Ideally, I'd like to keep my program in pure python, so I would like to not use PyObjC. 理想情况下,我想将程序保留在纯python中,所以我不想使用PyObjC。

According to Robin Dunn (creator of wxPython), wxPython 2.9.2 supports NSStatusItem (and related widgets): http://wxpython-users.1045709.n5.nabble.com/Raising-a-wxpython-frame-from-a-PyObjC-NSStatusBar-td4559330.html 根据Robin Dunn(wxPython的创建者)的说法,wxPython 2.9.2支持NSStatusItem(和相关小部件): http ://wxpython-users.1045709.n5.nabble.com/Raising-a-wxpython-frame-from-a- PyObjC-NSStatusBar-td4559330.html

It also supports the Taskbar / system tray icons on Windows. 它还支持Windows上的任务栏/系统任务栏图标。

Refer to this: How to make an menu bar (system tray) app for OSX in Python? 参照此: 如何在Python中制作OSX的菜单栏(系统任务栏)应用程序?

In the answer to the question, Jared creates an app with rumps . 在回答问题时,Jared创建了一个带有rumps的应用程序。

You can also check this code to create a menubar app using PyObjC only. 您还可以检查此代码以仅使用PyObjC创建菜单栏应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM