Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom binding problem...can't figure out how to trigger a notification on set



Hello, I have a simple bindings problem I'm hoping somebody can help
me with. I have condensed down my problem into a simple example
program which I have posted here:
http://www.geocities.com/ewing2121/NotificationProblem.tgz

Basically, I have a custom view object with a property I want to bind.
In this case, it is color. I wish to bind my color property to the
NSColorWell widget.

My problem is that the bindings seem to only work in one direction. I
can change the color wheel from the NSColorWell and my view object
changes appropriately. But if I set my view object's color directly,
the NSColorWell does not seem to get the notification that I changed
the view color so it does update itself.

I don't know what I'm supposed to do to 'trigger' this notification.
Can some body tell me where I'm going wrong?

The example program has a custom view that paints the entire view the
specified color. If you click on the NSColorWell, you should be able
to change the view colors. If you click on the buttons labeled with
different color names, they change the view color, but the NSColorWell
will not change to keep in sync.

Thanks,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.