• 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
Knowing when font panel is visible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Knowing when font panel is visible


  • Subject: Knowing when font panel is visible
  • From: Antonio Nunes <email@hidden>
  • Date: Sun, 04 Sep 2011 09:40:56 +0200

Hi,

I have a control that needs to be highlighted when the font panel is visible. This turns out not to be an easy task. I can't find any notifications that will be triggered whenever the font panel is shown or is hidden.

windowDidUpdate: might do for discovering that the window is or has become visible, but it's a bit hawkish to use for this purpose.
windowWillClose: only notifies if the panel gets closed, not if it is ordered out.

I tried subclassing NSFontPanel by doing the following:

- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
	[NSFontManager setFontPanelFactory:[MY_FontPanel class]];
}

but it doesn't appear to work. The font panel returned by [NSFontPanel sharedFontPanel] continues to be NSFontPanel, not MY_FontPanel.

What I want to do is override orderFront: and orderOut: in my subclass so that I can send out some notifications whenever one of these is called.

Why does my call to setFontPanelFactory: not work, and how can I best achieve my stated goal?

Kind Regards,
António Nunes
SintraWorks


-----------------------------------------------
Touch is a language without words
-----------------------------------------------




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Knowing when font panel is visible
      • From: "email@hidden" <email@hidden>
    • Re: Knowing when font panel is visible
      • From: Quincey Morris <email@hidden>
  • Prev by Date: keylayout in Lion
  • Next by Date: Re: Best Practices for Associating a File Extension With a File in XCode 4?
  • Previous by thread: keylayout in Lion
  • Next by thread: Re: Knowing when font panel is visible
  • Index(es):
    • Date
    • Thread