Re: Initialising NSTableColumn ??? Continued from : Setting NSPopUpButtonCell Value from NSTable
Re: Initialising NSTableColumn ??? Continued from : Setting NSPopUpButtonCell Value from NSTable
- Subject: Re: Initialising NSTableColumn ??? Continued from : Setting NSPopUpButtonCell Value from NSTable
- From: "Alexander F. Hartner" <email@hidden>
- Date: Mon, 5 Jul 2004 08:10:10 +0200
I tried to do this, but each row should have different elements in the
popup. For this to work I need a NSTableColumn which dataCellForRow
which returns a separate instance as from objectValueForTableColumn you
cannot set the values of the drop down. This is at least my
understanding, which might very well be incorrect.
I hope I am wrong and there is a nicer way of doing this.
Alex
On 04 Jul 2004, at 22:42, Chris Hanson wrote:
It looks like you want the same menu for every pop-up button cell in
your table column. If that's the case, then you don't need to
override NSTableColumn or anything like that. All you need to do is
configure a single NSPopUpButtonCell and set it as your
NSTableColumn's dataCell. Then, in your data source, for the value of
a row in that NSTableColumn just return an NSNumber containing the
index of the selected item.
On Jaguar and earlier, you'll have to configure and assign the
NSPopUpButtonCell in an -awakeFromNib method, probably in whatever
you're using as a delegate or dataSource for your NSTableView. (You
can make this easier by configuring a menu in Interface Builder, and
just telling the NSPopUpButtonCell to use it.) In Panther, you can
attach an NSPopUpButtonCell to your NSTableColumn directly in
Interface Builder and configure it entirely from the Info window.
-- Chris
--
Chris Hanson <email@hidden>
http://www.livejournal.com/users/chanson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.