Re: Custom NSView subclass + binding in IB
Re: Custom NSView subclass + binding in IB
- Subject: Re: Custom NSView subclass + binding in IB
- From: Daniel Yankowsky <email@hidden>
- Date: Tue, 15 Feb 2005 18:54:55 -0500
Hey, thanks a lot!
I read through JoystickView.m, and I think I understand how it works. The bit that I'm trying to sidestep is this section in MyDocument.m
// we can't do these in IB at the moment, as
// we don't have palette items for them
...
[shadowInspector bind: @"offset" toObject: graphicsController
withKeyPath:@"selection.shadowOffset" options:options];
[options setObject:@"RadiansToDegreesTransformer"
forKey:@"NSValueTransformerName"];
[shadowInspector bind: @"angle" toObject: graphicsController
withKeyPath:@"selection.shadowAngle" options:options];
Is there any way to get this to work without the need for the manual binding? Ideally, I would like to select my JoystickView instance in IB and, in the binding inspector, see all of the properties provided by JoystickView. Or, in my case, I want to be able to see that "hue" is bindable.
Who knows... maybe this isn't possible (yet).
On Feb 15, 2005, at 12:23 AM, Tim Lucas wrote:
On 15/02/2005, at 3:57 PM, Daniel Yankowsky wrote:
Hi all!
I'm relatively new to Cocoa programming. I'm trying to mess with Cocoa bindings.
uh oh
I have a custom subclass of an NSView. I want to bind a slider in my window to a property that I created of that view called "hue". However, I can't seem to convince IB to display this property in the bindings inspector page.
You missed mmalc's list resources post by 1 minute. Its not easy, but check out the "Graphics Bindings" example here:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
I have read some allusions to the fact that you need to create an IB Palette to show bindings for a custom NSView subclass in IB. Is this true? If so, isn't that pretty lame?
You don't need to do that... though it isn't simple (let alone easy). See "Graphics Bindings" above (specifically JoystickView.m)
- tim lucas
http://www.toolmantim.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden