From e845fcbf78a0f170e48e2383bd6a60eee68064d0 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 20 Aug 2014 21:43:28 -0400 Subject: Implemented Table.OnSelected() on Mac OS X. --- redo/table_darwin.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'redo/table_darwin.m') diff --git a/redo/table_darwin.m b/redo/table_darwin.m index 5fdac83..a8c85be 100644 --- a/redo/table_darwin.m +++ b/redo/table_darwin.m @@ -17,7 +17,7 @@ @implementation goTableColumn @end -@interface goTableDataSource : NSObject { +@interface goTableDataSource : NSObject { @public void *gotable; } @@ -63,6 +63,11 @@ goTableDataSource_toggled(self->gotable, (intptr_t) row, colnum, [value boolValue]); } +- (void)tableViewSelectionDidChange:(NSNotification *)note +{ + tableSelectionChanged(self->gotable); +} + @end id newTable(void) @@ -134,6 +139,7 @@ void tableUpdate(id t) [toNSTableView(t) reloadData]; } +// also sets the delegate void tableMakeDataSource(id table, void *gotable) { goTableDataSource *model; @@ -141,6 +147,7 @@ void tableMakeDataSource(id table, void *gotable) model = [goTableDataSource new]; model->gotable = gotable; [toNSTableView(table) setDataSource:model]; + [toNSTableView(table) setDelegate:model]; } // -[NSTableView sizeToFit] does not actually size to fit -- cgit v1.2.3