Re: Providing bindings support
Re: Providing bindings support
- Subject: Re: Providing bindings support
- From: Chris Hanson <email@hidden>
- Date: Mon, 15 Dec 2003 00:49:56 -0600
On Dec 15, 2003, at 12:02 AM, Francisco Tolmasky wrote:
Does anyone know of any documentation that will give you a crash
course on making a view that supports bindings. I'm actually just
subclassing an nstextview and would like to add some additional
bindings but am unsure how to do so.
In your NSTextField subclass itself, you'll need to use a +initialize
class method to register your bindings with
+[NSObject(NSKeyValueBindingCreation) exposeBinding:].
You'll also have to create an Interface Builder palette containing your
NSTextField subclass. This is because there's currently no other way
(to my knowledge anyway) to tell Interface Builder that a class has a
particular binding.
It's very easy to create an IB palette for an NSView or NSControl
subclass though. Just instantiate an object of the appropriate class
in the palette's palette nib; when you install and use the palette,
you'll be able to just drag out of this. You don't have to create an
inspector or any of that. If you have additional instance variables to
set though you'll need to be sure to implement the NSCoding methods,
and you may also want to create a full inspector.
-- Chris
--
Chris Hanson <email@hidden>
Weblog:
http://www.livejournal.com/users/chanson/
Resume:
http://bdistributed.com/people/cmh/resume.html
Looking for work developing Java or Mac OS X applications
_______________________________________________
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.