[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSButtonCell in NSTableView problem

From: address@hidden
Subject: Re: NSButtonCell in NSTableView problem
Date: Wed, 28 Nov 2007 09:49:19 -0800 (PST)
User-agent: G2/1.0

On 28 Nov., 18:14, Andreas Höschler <address@hidden> wrote:
> Hi all,
> I am pulling my hair out. In a preferences panel I am building a
> tableView manually with three columns, one tableColumn with a button
> cell:
>         tableColumn  = [[NSTableColumn alloc] initWithIdentifier:@"active"];
>                NSButtonCell *buttonCell = [[GSButtonCell alloc]
> initTextCell:@""];
>                [buttonCell setButtonType:NSSwitchButton];
>                [buttonCell setImagePosition:NSImageOnly];
>                [buttonCell setSelectable:NO];
>                [tableColumn setDataCell:buttonCell];
>                [buttonCell release];
>                [(NSCell *)[tableColumn dataCell]
> setAlignment:NSCenterTextAlignment];
>        [tableView addTableColumn:tableColumn];
>     [tableView setDataSource:self];
>     [tableView setDelegate:self];
>     [[tableView tableColumnWithIdentifier:@"active"] setEditable:YES];
>     [[[tableView tableColumnWithIdentifier:@"active"] dataCell]
> setEditable:YES];
>     [[[tableView tableColumnWithIdentifier:@"active"] dataCell]
> setSelectable:YES];
> When I click on the switch I expect
> - (void)tableView:(NSTableView *)tableView setObjectValue:(id)object
> forTableColumn:(NSTableColumn *)tableColumn row:(int)row;
> to be called but that is not the case. If I doubleclick into one of the
> NSTextFieldCells and end editing then the method is called!? What am I
> missing. This neither works on GNustep nor on MacOSX so I must be
> missing something obvious but I don't see what. Any idea?
> Thanks a lot,
>    Andreas

I am not sure about that but I think clicking on Checkboxes and
buttons in NSTableView is not considered as "editing".

And, there might be some relation between [buttonCell
setSelectable:NO]; and a cell being editable.

BTW: Why do you use GSButtonCell?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]