Re: bindings for nsmatrix
Re: bindings for nsmatrix
- Subject: Re: bindings for nsmatrix
- From: Emory Smith <email@hidden>
- Date: Sat, 5 Mar 2005 22:24:18 -0700
hi byron,
so does this mean that i must have a custom NSMatrix subclass?
i actually did create one, just to test whether this would work and
found that it did. its just that to do so seems extraneous, since the
only reason for it would be to expose the bindings that are already
present in NSMatrix.
also, how do you programmatically associate an NSMatrix (or subclass
thereof) with a custom cell? i would assume (since MSMatrix is a
subclass of NSControl) that you would use setCellClass. the problem is
that i want to create the matrices (matrixes?) in IB by alt-dragging
and im not sure how to tell IB "you should use this particular subclass
of NSMatrix and expose these particular bindings whenever i alt-drag on
this particular custom subclass of NSControl". seems like something of
that sort must be feasible since the set of bindings available to a
matrix of text-fields cells is different than that available to a
matrix of button cells.
thanks,
emory
On Mar 5, 2005, at 6:59 PM, Byron Wright wrote:
I recently did something like this. I think you have to do it
programmatically. Here is some example code from my app.
//bindingOptions = NSMutableDictionary
[bindingOptions setObject:[NSNumber numberWithBool:YES]
forKey:@"NSInsertsNullPlaceholder"];
[bindingOptions setObject:[NSNumber numberWithBool:YES]
forKey:@"NSRaisesForNotApplicableKeys"];
//thumbGrid is an instance of my custom NSMatrixView. You can do this
in awakeFromNib. I have custom NSButtonCells associated with my custom
NSMatrixView. "
[thumbGrid bind:@"content" toObject: self
withKeyPath:@"arrangedObjects" options:bindingOptions];
//bind cells to thumbnailImage
[thumbGrid bind:@"contentValues" toObject: self
withKeyPath:@"arrangedObjects.thumbnailImage" options:bindingOptions];
Hope this helps.
Byron
On Mar 5, 2005, at 5:20 PM, Emory Smith wrote:
hello,
i have a custom control / cell pair for which i have created an IB
palette item. i drag my custom control from the palette to my window
and alt-drag it to get matrix. i have added some custom bindings to
my nscell subclass and these work great, the problem is that i have
to select each cell of the matrix and bind it individually.
i would like to use the "standard" matrix bindings (content,
selectedObjects, etc.) with my matrix of custom cells, but IB does
not show these bindings in the inspector.
what more do i need to do to expose these bindings in IB for a matrix
containing custom cells?
thanks,
emory
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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