• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Right way to build style sheets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Right way to build style sheets?


  • Subject: Re: Right way to build style sheets?
  • From: Jonathan Chaffer <email@hidden>
  • Date: Wed, 13 Nov 2002 15:20:16 -0500

On Wednesday, November 13, 2002, at 02:54 PM, Steve Mykytyn wrote:

I need to keep a list of styles for text: font, size, style, color, etc.
<snip>
So i suppose the next best thing would be to make a subclass of NSView that responded to the various text attribute selectors...

When I needed a widget to do this I implemented an NSControl that stored an NSFont and responded to font changes from the font manager.

- (void)changeFont:(id)sender
{
NSFont *oldFont = [self fontValue];
NSFont *newFont = [sender convertFont:oldFont];
[self setFontValue:newFont];

[super sendAction:[self action] to:[self target]];
} // changeFont:

The sendAction there allows a change in font to trigger a change in the interface elsewhere.
--
Jonathan Chaffer
Applications Developer, structure:interactive
(616) 364-7423 http://www.structureinteractive.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Right way to build style sheets? (From: Steve Mykytyn <email@hidden>)

  • Prev by Date: Re: Cocoa WebObjects
  • Next by Date: Re: Glyph range in textContainers
  • Previous by thread: Re: Right way to build style sheets?
  • Next by thread: Re: Trouble using SQLite and Blackhole Media's wrapper in Cocoa apps.
  • Index(es):
    • Date
    • Thread