使NSButton打开字体面板 [英] Make NSButton open fonts panel

查看:129
本文介绍了使NSButton打开字体面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在Mac OS X中打开一个按钮打开字体面板使用Cocoa,我有一个NSTextView在我的应用程序,并希望字体对话框显示时,当用户单击按钮。提前感谢!

I was wondering how to go about making a button open up the fonts panel in Mac OS X using Cocoa, I have an NSTextView in my application and want the fonts dialogue to display when the user clicks the button. Thanks in advance!

推荐答案

默认情况下出现的最后一个对象(你在编辑区域左边看到的对象)是字体管理器。您所要做的就是控制从按钮到字体管理器的拖动,并连接 orderFrontFontPanel:操作。

The last object that comes by default (those one that you see in the left from the editing area) is exactly the Font Manager. All you have to do is to control drag from your button to the font manager and connect the orderFrontFontPanel: action.


这篇关于使NSButton打开字体面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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