Re: TableColumn dataCell actions
Re: TableColumn dataCell actions
- Subject: Re: TableColumn dataCell actions
- From: Angela Brett <email@hidden>
- Date: Fri, 15 Nov 2002 21:54:28 +1300
At 10:36 PM +1300 11/11/2002, after some people pointed out that I
was handling the checkboxes in my table the hard way and I attempted
doing it the easy way, I wrote:
<boring stuff>
...the - (BOOL)tableView:(NSTableView *)aTableView
shouldEditTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex is not called either. I've checked that my object
is both the datasource and the delegate for the tableView. When I
click on the checkbox nothing happens at all as far as I can tell.
In fact, not even - (void)tableView:(NSTableView*)tableView
didClickTableColumn:(NSTableColumn *)tableColumn is called.
What am I missing?
Well, after much checking and re-checking of method name spelling and
nib settings, I finally got this to work. It turns out the reason the
checkboxes had stopped working was that I'd added a line of code
elsewhere to make a custom view the first responder (the view also
does not resign first responder.)
I didn't think that would be a problem because I was under the
impression that first responder only affects which view gets key
events, and that a mouse click always goes to the view which is
clicked on. However, as soon as I removed the line to make my custom
view stay first responder, everything in the table view started
working... it gets mouseClicked events, rows can be selected (which
is a pity actually, I liked it how it was without any rows ever being
selected, but that's another issue), and most importantly, clicking
on the checkboxes actually does something.
So there's my solution, just in case someone else has the same
problem. I'm a bit curious about how giving my view first responder
status stopped other views from even getting mouse events, but I
guess I'll read the NSResponder docs again.
--
Angela Brett
Email: email@hidden
http://acronyms.co.nz/angela
http://OldScientist.com
http://cocoa.co.nz
_______________________________________________
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.