# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1602733103 0 # Node ID a02ff89279278fb56ccb9ae5c6d94339d1e14e18 # Parent 6740154cec686ee76121ea4f241e13b65533c951 Mac: Change the listbox functions to use NSTableCellView. When a NSTableCellView already exists, use it don't editCell: diff -r 6740154cec68 -r a02ff8927927 mac/dw.m --- a/mac/dw.m Thu Oct 15 00:23:56 2020 +0000 +++ b/mac/dw.m Thu Oct 15 03:38:23 2020 +0000 @@ -5791,13 +5791,17 @@ { DWComboBox *combo = handle; - [combo addItemWithObjectValue:[ NSString stringWithUTF8String:text ]]; + [combo addItemWithObjectValue:[NSString stringWithUTF8String:text]]; } else if([object isMemberOfClass:[DWContainer class]]) { DWContainer *cont = handle; - NSString *nstr = [ NSString stringWithUTF8String:text ]; + NSString *nstr = [NSString stringWithUTF8String:text]; +#ifdef DW_USE_NSVIEW + NSArray *newrow = [NSArray arrayWithObject:_dw_table_cell_view_new(nil, nstr)]; +#else NSArray *newrow = [NSArray arrayWithObject:nstr]; +#endif [cont addRow:newrow]; [cont reloadData]; @@ -5826,13 +5830,17 @@ { DWComboBox *combo = handle; - [combo insertItemWithObjectValue:[ NSString stringWithUTF8String:text ] atIndex:pos]; + [combo insertItemWithObjectValue:[NSString stringWithUTF8String:text] atIndex:pos]; } else if([object isMemberOfClass:[DWContainer class]]) { DWContainer *cont = handle; - NSString *nstr = [ NSString stringWithUTF8String:text ]; + NSString *nstr = [NSString stringWithUTF8String:text]; +#ifdef DW_USE_NSVIEW + NSArray *newrow = [NSArray arrayWithObject:_dw_table_cell_view_new(nil, nstr)]; +#else NSArray *newrow = [NSArray arrayWithObject:nstr]; +#endif [cont insertRow:newrow at:pos]; [cont reloadData]; @@ -5875,7 +5883,11 @@ for(z=0;z