如何使用wx在Mac OS X上设置菜单栏图标 [英] how to set a menubar icon on mac osx using wx

查看:166
本文介绍了如何使用wx在Mac OS X上设置菜单栏图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到有关如何使用wx在OSX上创建菜单栏图标的指针.我本来以为wxTaskBarIcon类会做,但是实际上在Dock上创建了一个图标.在Windows上,wxTaskBarIcon创建一个Systray图标和相关菜单,我想在mac osx上它会创建一个菜单栏图标,我想不是.

I could not find any pointers on how to create a menubar icon on OSX using wx. I originally thought that the wxTaskBarIcon class would do, but it actually creates an icon on the Dock. On Windows, wxTaskBarIcon creates a Systray icon and associated menu, and I would think that on mac osx it would create a menubar icon, I guess not.

推荐答案

您必须将wxTaskBarIconType设置为STATUSITEM,而不是DOCK.为此的可可API是NSStatusBarNSStatusItem这是wxWidgets中调用它们的代码.

You have to set wxTaskBarIconType to STATUSITEM, not DOCK. The Cocoa APIs for this are NSStatusBar and NSStatusItem; here's the code in wxWidgets that calls to them.

这篇关于如何使用wx在Mac OS X上设置菜单栏图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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