简体   繁体   English

如何更改NSToolBarItem打印上的图标

[英]How to change icon on NSToolBarItem print

Is there a way to change icon on NSToolBarItem print? 有没有办法更改NSToolBarItem打印上的图标? The setter for this is available via InterfaceBuilder but if I change it - it changes only in Interface Builder but not in working project. 可以通过InterfaceBuilder获得此设置器,但是如果我更改它,则只能在Interface Builder中更改,而不能在工作项目中更改。 I tried to change it from code - but the same result. 我试图从代码中更改它-但结果相同。 I have default print icon both cases. 两种情况下我都有默认的打印图标。 Thanks. 谢谢。

If this can not be changed what you can create your own toolbar item that will work for as Print. 如果无法更改,则可以创建自己的工具栏项 ,将其用作“打印”。

Set new image for the toolbar button, and give Label and Palette Label, I have used My Print. 为工具栏按钮设置新图像,并给我标签和调色板标签,我已经使用了我的打印。 在此处输入图片说明

Now you need to hook Print menu and Toolbar item's to a method, I have a method called print in the AppDelegate. 现在,您需要将“打印”菜单和“工具栏”项挂接到一个方法上,我在AppDelegate中有一个称为“ print的方法。

在此处输入图片说明

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

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