Cocoa - 在菜单栏中自定义NSStatusItem的外观 [英] Cocoa - Custom appearance of NSStatusItem in menu bar

查看:439
本文介绍了Cocoa - 在菜单栏中自定义NSStatusItem的外观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很容易设置NSStatusItem的标题和长度。是否可以完全更改NSStatusItem的外观,并将其替换为自定义视图?

It is easy to set the title and length of an NSStatusItem. Is is possible to change the appearance of the NSStatusItem entirely, and replace it with a custom view?

例如,如果我想我的NSStatusItem是一整行图标由一个边框包围,而不仅仅是一个单一的图标,每个图标可以单独点击。这是可能吗?

For example, if I want my NSStatusItem to be a whole row of icons surrounded by a border, rather than just a single icon, and each icon can be separately clicked. Is this possible?

推荐答案

我可以使用NSStatusItem的 setView:方法来完全自定义NSStatusItem的外观。

Got it. I can use NSStatusItem's setView: method to completely customize the appearance of the NSStatusItem.

a href =http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem>此处。

An example of this is here.

这篇关于Cocoa - 在菜单栏中自定义NSStatusItem的外观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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