• 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
Better way to deal with NSFontPanel in a preference pane
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Better way to deal with NSFontPanel in a preference pane


  • Subject: Better way to deal with NSFontPanel in a preference pane
  • From: Sailor Quasar <email@hidden>
  • Date: Mon, 16 Feb 2004 00:07:19 -0500

This isn't a problem in the sense that I have no solution to it, but it's nagging at me because of the hack I had to do to make it work.

Basically, I have a button in my preference pane that shows the Font panel. The Font panel, on user selection, sends a -changeFont: message up the responder chain. I need it to send the message to a delegate, because the idea is to store a font and size (and attributes etc.) for later use by the faceless background app the pane controls. Since I don't have direct access to the responder chain for System Preferences, naturally, my solution was to create a subclass of NSResponder, manually insert it into the responder chain (just before [NSApp mainWindow] and set its nextResponder to the original one), and have it call back into my pane controller.

This works reliably, but it feels like a hack. Is there a better way to pick a font for later use? I don't want to have to implement a font menu, a size menu, an attributes menu... that's what the font panel is for!

-- Sailor Quasar, just another player in The World
"Come with me in the twilight of the summer night for awhile"
Email: email@hidden
_______________________________________________
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: Better way to deal with NSFontPanel in a preference pane
      • From: "Louis C. Sacha" <email@hidden>
    • Re: Better way to deal with NSFontPanel in a preference pane
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Slow Cocoa
  • Next by Date: Re: calling method via IMP that returns non id type - compiler warning
  • Previous by thread: Re: Slow Cocoa
  • Next by thread: Re: Better way to deal with NSFontPanel in a preference pane
  • Index(es):
    • Date
    • Thread