On 28 Nov., 18:14, Andreas Höschler <[EMAIL PROTECTED]> 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? Nikolaus _______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
