Re: Checkbox in NSOutlineView. Must move mouse > 3 pixels to toggle
Re: Checkbox in NSOutlineView. Must move mouse > 3 pixels to toggle
- Subject: Re: Checkbox in NSOutlineView. Must move mouse > 3 pixels to toggle
- From: "I. Savant" <email@hidden>
- Date: Thu, 27 Jul 2006 16:13:10 -0400
Jerry:
Just for perspective (as I don't have any specific suggestions): I
am using the data source methods with an outline view in one of my
projects and it behaves properly (ie, I do not get the behavior you
described).
--
I.S.
On Jul 27, 2006, at 3:53 PM, Jerry Krinock wrote:
I have an NSOutlineView with a checkbox column. The system should
send its
dataSource delegate a
outlineView:setObjectValue:forTableColumn:byItem:
message whenever the user clicks the checkbox.
However, I find that once I click in a checkbox, clicking again
does not
re-send outlineView:setObjectValue:forTableColumn:byItem: unless I
have
moved my mouse by greater than 3 pixels in any direction from where
it was
during the previous click which successfully toggled it. Waiting
does not
help. You've got to move it 4 pixels or more.
Anyone have a good guess what might cause this behavior?
Jerry Krinock
The NSOutlineView has two columns. The first column is the
checkbox I'm
having trouble with, the second column is the "outline" column.
The checkbox is NSSmallControlSize, 12x12 pixels and has
setAllowsMixedState:YES. When the user clicks it, it will change to
NSOnState or NSOffState. (I don't know why the user cannot change
it to
NSMixedState, but fortunately this is the behavior that I want. I
set it to
NSMixedState, when needed, programatically.)
The NSTableColumn in which the checkbox lives has been subclassed
twice to
override dataCellForRow:. The first-level subclass returns a generic
checkbox-style NSButtonCell. The second-level subclass simply
sends the
cell setAllowsMixedState:YES. Commenting out this message does not
affect
the problem.
// ***** First Level Subclass
@interface SSCheckboxTableColumn : NSTableColumn
{
}
@end
@implementation SSCheckboxTableColumn
- (id)dataCellForRow:(int)iRow
{
NSButtonCell * cell =[[NSButtonCell alloc] init];
[cell setControlSize:NSSmallControlSize] ;
[cell setButtonType:NSSwitchButton] ;
[cell setTitle:@""] ;
[cell setImagePosition:NSImageOnly] ;
return [cell autorelease] ;
}
@end
// ***** Second Level Subclass
@interface TableColumnTasksCopy : SSCheckboxTableColumn
{
}
@end
@implementation TableColumnTasksCopy
- (id)dataCellForRow:(int)iRow
{
NSButtonCell * cell = [super dataCellForRow:iRow] ;
[cell setAllowsMixedState:YES] ;
return cell ;
}
@end
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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