• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bindings for nsmatrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: bindings for nsmatrix
      • From: Byron Wright <email@hidden>
References: 
 >bindings for nsmatrix (From: Emory Smith <email@hidden>)
 >Re: bindings for nsmatrix (From: Byron Wright <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 2, Issue 302
  • Next by Date: Adding a category to a protocol
  • Previous by thread: Re: bindings for nsmatrix
  • Next by thread: Re: bindings for nsmatrix
  • Index(es):
    • Date
    • Thread