User defaults controller layer/NSTextField binding question
User defaults controller layer/NSTextField binding question
- Subject: User defaults controller layer/NSTextField binding question
- From: John Clayton <email@hidden>
- Date: Sat, 25 Oct 2003 08:18:13 -0400
Hi Everyone,
Well, I've been digging around on this for a while, but of course not
able to ask a question here. I've learned a lot about the controller
layer, and using it to manage user defaults via pref panel, I'm
starting to realize how much less code you can write. Here's one
question that's got me a little stuck. Maybe there's somebody out
there who's already figured it out.
I have a button that opens up the font panel. Next to it we have a
text field that displays the font description in the actual font that's
the user default. This was easy to do by binding the value and the
font to the use defaults key using the shared user defaults controller.
But here comes the kicker. Since the text field doesn't respond to
the font panel, I wrote some code to intercept changeFont: and change
the font of the field directly. But when you do this, the controller
layer doesn't pay attention to the change and never updates the
defaults, nor the font description. I looked at using a text view, but
it has virtually no bindings with the defaults controller. I thought
I might be able to access the controller values directly via code. It
seems you can get at the controller like this [NSUserDefaultsController
sharedUserDefaultsController], but I can't see any way of affect values
directly.
I'd love to know how anybody else out there has solved this problem, or
if I've missed some obvious examples in the docs. Thanks!
John Clayton
_______________________________________________
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.