Re: NSCombobox subclass and binding ?
Re: NSCombobox subclass and binding ?
- Subject: Re: NSCombobox subclass and binding ?
- From: Ricky Sharp <email@hidden>
- Date: Fri, 8 Jul 2005 22:41:05 -0500
On Jul 8, 2005, at 5:15 PM, Robert Miller wrote:
I hope someone can help. I have a subclass of NSCombobox that
displays a custom resizable popup list instead of the standard
fixed size list. The subclass list populates fine when using an
internal list defined in a nib for the custom combo box class by
simply making the subclass box the data source of my table I can do
this:
- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [self numberOfItems];
}
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:
(NSTableColumn *)aTableColumn row:(int)rowIndex
{
return [self itemObjectValueAtIndex:rowIndex];
}
However, when bindings are attached to the subclass the list does
not populate. The question is how can I take advantage of
NSCombobox'es default binding and obtain the data from that binding
to populate the custom popup list ? Any help would be greatly
appreciated.
I don't think that is possible to do. When originally doing a custom
radio group (NSMatrix containing subclasses of NSActionCell), I
couldn't use the selectedTag or selectedIndex bindings to get both
model-initiated and view-initiated changes handled. I remedied the
problem by subclassing NSMatrix (IIRadioGroup) and adding my own
custom binding (selectedRadioTag).
Thus, look into adding a custom binding to your NSCombobox subclass.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.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