Re: Defining Accessors in a Custom Palette for a NSArray for Cocoa Bindings
Re: Defining Accessors in a Custom Palette for a NSArray for Cocoa Bindings
- Subject: Re: Defining Accessors in a Custom Palette for a NSArray for Cocoa Bindings
- From: "E. Wing" <email@hidden>
- Date: Tue, 11 Jan 2005 05:14:21 -0800
Thank you again for the response. I think I need a few more concrete
details to get over this hurdle if you don't mind...
> It's a little difficult to tell exactly what your intent is, but I
> *think* you could do it either way.
My intent was to create a self-contained palette that could draw a
line (say with an OpenGL backend). I wanted the users of my palette
to drag my palette-view into their application and be able to define
how to draw the line by adding an NSTableView (with 3 columns for x,
y, z) to their application. Using Cocoa bindings, I was hoping my
palette could see all the points inserted in the table and then update
itself to draw lines between each point.
The less the enduser of my palette knows of my implementation, the
better, as I don't want to burden them with the details of my
implementation. But, for now, I would settle for whatever I can get
working because much of this is a proof of concept project I need to
get done to convince my managers that this can actually be done.
> You could probably create a self-contained palette item that includes
> an array controller, and which provides bindings such that you could
> hook up the controller much as you would a stand-alone controller.
In this first case you describe, are you suggesting I create a second
palette (a non-view based palette) which is merely an array
controller? Then I would attempt to bind my Line-drawing palettle and
the final application's palette to this controller palette?
> I'd
> be more inclined, though, to go for the simpler approach of just
> putting the view on the palette and hooking it up to a standard array
> controller that you bind in turn to whatever is appropriate.
And in the simpler approach you describe, can you elaborate more on
what I need to? I didn't quite understand this. I currently have my
palette. It contains an NSMutableArray as an ivar and expose it as a
binding. My 2 failures seem to be that I am unable to specify its
behaviors for things like insert and remove (where I want to invoke
OpenGL code for drawing), and I have been unable to specify that this
array has elements of type "LinePoint". To fix this, you are saying I
need to get an NSArrayController into this some how, which does
actually make sense to me. But I'm still blank on the how part.
Thanks again,
Eric
_______________________________________________
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