• 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: Saving NSFonts and changedFont: trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving NSFonts and changedFont: trouble


  • Subject: Re: Saving NSFonts and changedFont: trouble
  • From: Thomas Backman <email@hidden>
  • Date: Tue, 8 Apr 2008 17:34:48 +0200

Yep, I am, unfortunately.
The whole method, bar 3 lines for saving to user defaults, is
- (void)changeFont:(id)sender {
    NSFont *oldFont = [textView font];
    NSFont *newFont = [sender convertFont:oldFont];
    [textView setFont:newFont];
}

Worth mentioning is that before clicking in the textview, the font panel is pretty "blank". No font or size selected. In this state, everything works. Then, when I click in the view, the correct family and size is selected, and it's no longer possible to change anything; it simply ignores it. I'm guessing the message is being sent to the wrong object... How do I tell the panel where to send all messages for the entire program? TBH I'm not sure why it *does* work at all. ;)

/Thomas


On Apr 8, 2008, at 4:57 PM, Michael Vannorsdel wrote:
Are you sending convertFont: to the sender of changedFont:? I think this is required or controls start to get confused. May or may not solve your problem though.


On Apr 8, 2008, at 8:41 AM, Thomas Backman wrote:

Hey everybody. I'm working on a small app - to make the post shorter, lets just say that it displays (plain) text, but I want the user to be able to pick the font used (the same font should be used for all the text).
Right now, I have a changedFont: method in my controller class, that changes the font successfully, and saves the font+size as a string and float. First off, is there a better way to save things? There has to be. Anyway, that wasn't my main question. More importantly, this does work, until you click in the textview... When that happens, changedFont: is no longer called, and the font stays the same.
Why? (It works again after an app restart.)
I've tried setting the textview delegate, and a sharedFontManager delegate, to my controller. (Not sure about what I'm doing here, as you might have noticed)


I realize I'm short on info, but I'm not exactly sure what info to provide, so please ask if you need more.
_______________________________________________

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: Saving NSFonts and changedFont: trouble
      • From: Michael Vannorsdel <email@hidden>
References: 
 >Saving NSFonts and changedFont: trouble (From: Thomas Backman <email@hidden>)
 >Re: Saving NSFonts and changedFont: trouble (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: Reformatting percent string to two decimal places
  • Next by Date: Re: Core Animation layer-backed NSViews and mouse handling
  • Previous by thread: Re: Saving NSFonts and changedFont: trouble
  • Next by thread: Re: Saving NSFonts and changedFont: trouble
  • Index(es):
    • Date
    • Thread