NSPopUpButtonCell in subclass of NSCell - Selection not working
NSPopUpButtonCell in subclass of NSCell - Selection not working
- Subject: NSPopUpButtonCell in subclass of NSCell - Selection not working
- From: Michael Becker <email@hidden>
- Date: Mon, 8 Nov 2004 14:16:56 +0100
Hi!
Okay, it seems like I am finally almost done with this, there's only
one major flaw. I have a tableview displaying custom cells in one
column. The custom cells hold an NSImage and an NSPopUpButton. Now
here's my problem: I cannot get the NSPopUpButton to work properly.
I have managed to set up my custom cell so that the NSPopUpButton is
connected to my controller via the action/target mechanism. I actually
really ONLY set up the NSPopUpButton for the action/target. So whenever
(and only when) the user changes the selection of any of the displayed
NSPopUpButtons, the following code produces output:
- (void)cartItemChangedVariant:(id)sender
{
NSLog(@"%@", sender); // This tells me that NSTableView is the
sender??
}
Actually I want this method (the action) to get the newly selected item
of the NSPopUpButton and save the selected index to my model object. In
-tableView:willDisplayCell:forTableColumn:row: I would re-apply the
selections to the actual NSPopUpButtons. (Thanks to M.Uli Kusterer for
pointing that out to me)
However, I cannot see any way of *receiving* the selection changes.
Since the "sender" (see above) is the NSTableView, I cannot seem to
reach the actual NSPopUpButton which the user just clicked and changed.
Any help would be greatly appreciated.
Cheers,
Michael
_______________________________________________
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