• 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: Getting color attribute from NSFontPanel/NSFontManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting color attribute from NSFontPanel/NSFontManager


  • Subject: Re: Getting color attribute from NSFontPanel/NSFontManager
  • From: "Julio Cesar Silva dos Santos" <email@hidden>
  • Date: Tue, 12 Dec 2006 14:20:54 -0200

You must set the delegate of the NSFontManager:

[[NSFontManager sharedFontManager] setDelegate:self];

Then changeFont: will be called.
--
Julio Cesar Silva dos Santos
email@hidden

2006/12/12, Vinay Prabhu <email@hidden>:

Hi,

I am trying to launch the Font Panel, when user clicks on the button in
the
window.
The requirement is such that I can not use the Font Menu for launching the
Font Panel.

The code,

[[NSFontManager sharedFontManager] setAction:@selector(changeFont:)];
[[NSFontManager sharedFontManager] orderFrontFontPanel:self];

When new font is selected or any font attributes are changed (color
attribute) in the Font Panel, "changeFont" action is not called.

So to obtain the changes made in  Font Panel, I have used following
method.
1) I have registered the controller class to receive the
NSWindowWillCloseNotification for NSFontPanel shared object.
So that when Font Panel is closed, controller class will receive a
notification.
2) In the windowWillClose method, I am trying to get the new font from
Font
Panel.
NSFont* newFont = [[NSFontPanel sharedFontPanel]
panelConvertFont:oldFont];
The newFont object will have all the new attributes like Font Family, Font
Style, Font Size etc, except for the Foreground Color, Text Underline and
Text StrikeThrough set
in the Font Panel.

Is there anyway to obtain Foreground Color, Text Underline and Text
StrikeThrough attributes from Font Panel?

Regards
Vinay
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Getting color attribute from NSFontPanel/NSFontManager
      • From: Vinay Prabhu <email@hidden>
References: 
 >Getting color attribute from NSFontPanel/NSFontManager (From: Vinay Prabhu <email@hidden>)

  • Prev by Date: Re: Bindings and C Array
  • Next by Date: Re: How to set left side title to NSPopupButton
  • Previous by thread: Getting color attribute from NSFontPanel/NSFontManager
  • Next by thread: RE: Getting color attribute from NSFontPanel/NSFontManager
  • Index(es):
    • Date
    • Thread