• 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: NSFontManager changeFont not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFontManager changeFont not called


  • Subject: Re: NSFontManager changeFont not called
  • From: Alexander Veenendaal <email@hidden>
  • Date: Tue, 25 Jun 2002 20:52:27 +0100

On Monday, June 24, 2002, at 12:26 PM, Scott Anguish wrote:
On Monday, June 24, 2002, at 06:30 AM, Alexander Veenendaal wrote:

I am having issues trying to get the font panel to send a changeFont: message to my NSView subclass. A similar problem has been asked a few times before:


look at this instead...

http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
FontHandling/Tasks/RespondingToFontChanges.html

Didn't really help that much.

or, if you don't mind muddling through code that hasn't been moved to Cocoa yet, but is applicable (it's for setting a font as a default in a panel)

http://www.stepwise.com/Articles/Technical/HTMLEditor/HTMLEditor-5.html

Following this guide, on the other hand, finally provided me with results.

What I did was:

- move the changeFont method to another class which I made a subclass of NSWindowController.

- In Interface Builder, I connected the NSWindowController subclasses window outlet to my applications window.

- I added this code to my NSWindowController subclass and connected it to a button in my applications window:
[[myView window] makeFirstResponder:[selectFontButton window]];
[[NSFontManager sharedFontManager] orderFrontFontPanel:self];
[[NSFontManager sharedFontManager] setSelectedFont:[myView font] isMultiple:NO];


et voila, changeFont gets called in the NSWindowController subclass when I make a selection in the FontManager.


However, I'm still not completely clear as to why the NSWindowController subclass worked and not the NSView subclass.
The Apple docs could be a little clearer on this matter.

thanks for the advice.
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSFontManager changeFont not called
      • From: Scott Anguish <email@hidden>
References: 
 >Re: NSFontManager changeFont not called (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 2 #836 - 12 msgs
  • Next by Date: Re: NSView and rectangle management
  • Previous by thread: Re: NSFontManager changeFont not called
  • Next by thread: Re: NSFontManager changeFont not called
  • Index(es):
    • Date
    • Thread