Re: NSPopUpButtonCell -- I need an outlet to gain access to the button
Re: NSPopUpButtonCell -- I need an outlet to gain access to the button
- Subject: Re: NSPopUpButtonCell -- I need an outlet to gain access to the button
- From: "I. Savant" <email@hidden>
- Date: Wed, 16 May 2007 12:53:21 -0400
Dalton:
I'm not sure why you're doing it this way, but if you're not using
Bindings, then you're already using the table data source methods, so
why not use the -tableView:setObjectValue:forTableColumn:row: data
source method to "do something"?
Maybe I'm unclear as to what you're actually trying to do (probably
because you haven't explained it ...), but it seems to me you're
making this more complicated than it needs to be. Again, without a
more thorough description of your problem, it's not clear how to solve
it.
--
I.S.
On 5/16/07, Dalton Hamilton <email@hidden> wrote:
Hello,
I'm trying to get an NSPopUpButton inside one of my columns of an
NSTableView. I've gotten really close but not quite there.
The NSPopUpButton shows by dong this:
NSTableColumn *typeSystemColumn;
NSPopUpButtonCell *cellSystemType;
cellSystemType = [[NSPopUpButtonCell alloc] init];
[cellSystemType setBordered:NO];
[cellSystemType addItemWithTitle:@"ESA"];
[cellSystemType addItemWithTitle:@"WSA"];
[cellSystemType setAction:@selector(systemTypeButtonAction:)];
[cellSystemType setTarget:self];
[cellSystemType setControlSize:NSSmallControlSize];
typeSystemColumn = [systemsTV tableColumnWithIdentifier:@"type"];
[typeSystemColumn setDataCell:cellSystemType];
[cellSystemType release];
The systemTypeButtonAction: method is called when I select the
button, however I don't know how to to get access to the
NSPopUpButton to figure out which index the user chose. The method
is defined as:
-(IBAction)systemTypeButtonAction:(id)sender
{
// sender is pointing to the NSTableView object. I need a way to
access the NSPopUpButton
// do something
}
And when it is called, the "sender" is the NSTableViw object. I need
something like an outlet.
Thanks a lot for any help. I've spent hours on the web trying to
figure this out -- I don't see any good (or complete) examples.
Dalton Hamilton
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden