Re: Changing fonts without font menu?
Re: Changing fonts without font menu?
- Subject: Re: Changing fonts without font menu?
- From: Fredrik Olsson <email@hidden>
- Date: Thu, 08 Jun 2006 16:48:58 +0200
Mradul Mandhanya skrev:
From IB you can do it easily by selecting the button title and selecting
the font attributes from font panel.
If want to do programmatically NSAttributedString may help u.
I think I was a bit unclear :).
What I want to do is to let a NSButton wotk the same way as for example
the "Bold"-menu item that is "provided for free" with the Format-menu,
or the Font-menu.
I want to have a button on a form, hook it up to the shared font manager
and send it addFontTraits actions, having it selected and deselected
depending on the current selection.
Hooking up a button to send underline to the first responder is esy, and
works as expected (minus updating the selected status), but doing the
same with bold, italic, increase/decrease font size, have proved to be a
harder task.
I attach a very small image of the edit tools, as an image says more
than 1000 words. What I want is for all the buttons in this image to
behave as expected.
Regards,
Mradul
-----Original Message-----
From: cocoa-dev-bounces+mmandhanya=email@hidden
[mailto:cocoa-dev-bounces+mmandhanya=email@hidden] On
Behalf Of Fredrik Olsson
Sent: Thursday, June 08, 2006 5:58 PM
To: Cocoa-dev
Subject: Changing fonts without font menu?
Having a NSFontManager and handling font changes from a standard font
menu is easy. But is there a way to hook up buttons to make text
bold/unbold?
I can not get sending addFontTrait actions to work, and the
documentation I have found only speaks of hooking up menus manually, not
other controls.
// Fredrik Olsson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden