FROM : Matt Neuburg
DATE : Mon Nov 01 17:47:26 2004
On Fri, 29 Oct 2004 12:11:58 -0700, Troy Payne <<email_removed>> said:
>Hi I am using cocoa, obj-c, and I want to change the font size of my
>NSTextView with a slider, like Font Book does. I don't need help with
>the slider part of it, just a basic way on how to change the font size
>of the contents of a NSTextView, using code, not a font panel.
With an NSTextView, you have to adjust the font for every style run
individually. Luckily in Panther this is really easy: call changeAttributes
and implement convertAttributes. Your convertAttributes will automatically
be called for each style run, so you can set the font size and return the
adjusted attributes dictionary. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
DATE : Mon Nov 01 17:47:26 2004
On Fri, 29 Oct 2004 12:11:58 -0700, Troy Payne <<email_removed>> said:
>Hi I am using cocoa, obj-c, and I want to change the font size of my
>NSTextView with a slider, like Font Book does. I don't need help with
>the slider part of it, just a basic way on how to change the font size
>of the contents of a NSTextView, using code, not a font panel.
With an NSTextView, you have to adjust the font for every style run
individually. Luckily in Panther this is really easy: call changeAttributes
and implement convertAttributes. Your convertAttributes will automatically
be called for each style run, so you can set the font size and return the
adjusted attributes dictionary. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
| Related mails | Author | Date |
|---|---|---|
| Troy Payne | Oct 29, 21:11 | |
| Lon Varscsak | Oct 29, 22:17 | |
| Matt Neuburg | Nov 1, 17:47 | |
| Douglas Davidson | Nov 1, 18:39 |






Cocoa mail archive

