On Mar 24, 2013, at 13:47 , Pascal Harris <[email protected]> wrote:
> Question 1. Is this possible, and am I even using the correct tool to do the
> job?
It's certainly possible to use popup buttons in a table column.
It's questionable whether this is the right tool for this job. Popup buttons
aren't great at showing multiple selections -- except when their menu is
actually popped up, of course. It's irritatingly harder (though not exceedingly
hard) to force the button to display a title that isn't the same as the
(single) selected item.
And what title to display? That's a significant problem, especially if "there
might be twenty [actions] in the future".
> At the moment, my code looks like this (nothing is happening yet - I'm just
> trying to see if I can get the toggle to work - and I can't):
> - (IBAction)cellPreferenceChanged:(id)sender
> {
> [[sender selectedItem] setState:NSOnState];
> }
>
> cellPreferenceChanged is bound to the NSPopUpButtonCell in IB.
What do you mean by "bound"? Are you using a Cocoa binding, or do you just mean
you've connected the "selector" connection from the cell to some target?
> Oddly, despite this binding, this code results in [NSTableView selectedItem]:
> unrecognized selector sent to instance. Why is this? Surely, since it is
> the NSPopUpButtonCell that is bound it should be the NSPopUpButtonCell
> instance for the selected row that is sent?
I dunno, but table views do things to cells that you might not always expect.
If you set a breakpoint in your 'cellPreferenceChanged' method, what does the
backtrace look like?
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]