NSToolbar:我如何初始化一个选定的项目? [英] NSToolbar: how do I initialise with a selected item?

查看:325
本文介绍了NSToolbar:我如何初始化一个选定的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Mac OS应用程序,其偏好窗口上有一个NSToolbar。

I have a Mac OS application with a preferences window with a NSToolbar on it.

我还有一个自定义子视图和其他3个自定义视图当用户点击其中一个选项时,在第一个选项内。

I have also a custom subview under it and other 3 custom views that are loaded inside the first one when the user clicks on one of the options.

到目前为止,这么好。现在我意识到,当窗口加载时默认情况下没有选择第一个项。

So far, so good. Now I realised the first item is not selected by default when the window is loaded.

我没有看到检查器中的选项,除了可选择,我使用。但是没有选择。我应该以编程方式吗?如何?

I see no options in the inspectors, except the "selectable", which I used. But there is no "selected". Should I do it programmatically? How?

推荐答案

NSToolbar 有一个可以在 -windowDidLoad 方法中使用的

这篇关于NSToolbar:我如何初始化一个选定的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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