Mercurial > dwindows
changeset 2189:a5d58393f7d0
Mac: Missed updating dw_filesystem_set_file() in that last commit.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 15 Oct 2020 04:39:18 +0000 |
parents | a02ff8927927 |
children | 4cb258fb6729 |
files | mac/dw.m |
diffstat | 1 files changed, 19 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Thu Oct 15 03:38:23 2020 +0000 +++ b/mac/dw.m Thu Oct 15 04:39:18 2020 +0000 @@ -7677,9 +7677,7 @@ /* If pointer is NULL we are getting a change request instead of set */ if(pointer) - { lastadd = [cont lastAddPoint]; - } if(data) { @@ -7737,7 +7735,7 @@ /* If it is a cell, change the content of the cell */ if([object isMemberOfClass:[NSTableCellView class]]) { - NSTableCellView *cell = [cont getRow:(row+lastadd) and:column]; + NSTableCellView *cell = object; if(icon) [[cell imageView] setImage:icon]; else @@ -7808,27 +7806,34 @@ { DW_FUNCTION_INIT; DWContainer *cont = handle; -#ifdef DW_USE_NSVIEW - NSTableCellView *browsercell; -#else - DWImageAndTextCell *browsercell; -#endif + NSString *text = filename ? [NSString stringWithUTF8String:filename] : nil; int lastadd = 0; /* If pointer is NULL we are getting a change request instead of set */ if(pointer) - { lastadd = [cont lastAddPoint]; - } #ifdef DW_USE_NSVIEW - browsercell = _dw_table_cell_view_new(icon, [NSString stringWithUTF8String:filename]); + id object = [cont getRow:(row+lastadd) and:0]; + + /* If it is a cell, change the content of the cell */ + if([object isMemberOfClass:[NSTableCellView class]]) + { + NSTableCellView *cell = object; + + if(icon) + [[cell imageView] setImage:icon]; + if(text) + [[cell textField] setStringValue:text]; + } + else /* Otherwise replace it with a new cell */ + [cont editCell:_dw_table_cell_view_new(icon, text) at:(row+lastadd) and:0]; #else - browsercell = [[[DWImageAndTextCell alloc] init] autorelease]; + DWImageAndTextCell *browsercell = [[[DWImageAndTextCell alloc] init] autorelease]; [browsercell setImage:icon]; - [browsercell setStringValue:[ NSString stringWithUTF8String:filename ]]; -#endif + [browsercell setStringValue:[NSString stringWithUTF8String:filename]]; [cont editCell:browsercell at:(row+lastadd) and:0]; +#endif [cont setNeedsDisplay:YES]; DW_FUNCTION_RETURN_NOTHING; }