diff --git a/redo/control.go b/redo/control.go index 4ba9618..b75386c 100644 --- a/redo/control.go +++ b/redo/control.go @@ -6,7 +6,6 @@ package ui // All Controls have event handlers that take a single argument (the Doer active during the event) and return nothing. type Control interface { setParent(p *controlParent) // controlParent defined per-platform - // TODO enable/disable (public) controlSizing } diff --git a/redo/future b/redo/future index 755ea4e..0fcd874 100644 --- a/redo/future +++ b/redo/future @@ -1,4 +1,12 @@ Group - Mac OS X: NSBox container.go: add Group to the list of controls in the description of container + Mac OS X: NSBox container_darwin.m: figure out if our setFrameSize: thing applies to resizing the groupbox as well +Control + Enable() + Disable() +Table + more column types: "// As such, a Table renders a []struct{...} where each field of the struct can be a string, a number, an image, or a checkbox." + table_darwin.m: constructor + table_unix.c: goTableModel_get_column_type(), goTableModel_get_value() + multiple selection diff --git a/redo/table.go b/redo/table.go index 7a0e174..a9b5ada 100644 --- a/redo/table.go +++ b/redo/table.go @@ -9,7 +9,7 @@ import ( ) // Table is a Control that displays a list of like-structured data in a grid where each row represents an item and each column represents a bit of data. -// As such, a Table renders a []struct{...} where each field of the struct can be a string, a number, [TODO an image, or a checkbox]. +// As such, a Table renders a []struct{...} where each field of the struct is rendered using package fmt's %v rule. // Tables maintain their own storage behind a sync.RWMutex-compatible sync.Locker; use Table.Lock()/Table.Unlock() to make changes and Table.RLock()/Table.RUnlock() to merely read values. // TODO headers type Table interface { diff --git a/redo/table_darwin.m b/redo/table_darwin.m index ec5ab2f..9a16082 100644 --- a/redo/table_darwin.m +++ b/redo/table_darwin.m @@ -40,14 +40,12 @@ id newTable(void) t = [[NSTableView alloc] initWithFrame:NSZeroRect]; [t setAllowsColumnReordering:NO]; [t setAllowsColumnResizing:YES]; - // TODO make this an option on all platforms [t setAllowsMultipleSelection:NO]; [t setAllowsEmptySelection:YES]; [t setAllowsColumnSelection:NO]; return (id) t; } -// TODO other types void tableAppendColumn(id t, char *name) { NSTableColumn *c; diff --git a/redo/table_unix.c b/redo/table_unix.c index 0fa9c5a..21dc38b 100644 --- a/redo/table_unix.c +++ b/redo/table_unix.c @@ -59,7 +59,6 @@ static GtkTreeModelFlags goTableModel_get_flags(GtkTreeModel *model) static GType goTableModel_get_column_type(GtkTreeModel *model, gint column) { - /* TODO change when we get more column types */ return G_TYPE_STRING; } @@ -99,7 +98,6 @@ static void goTableModel_get_value(GtkTreeModel *model, GtkTreeIter *iter, gint /* we (actually cgo) allocated str with malloc(), not g_malloc(), so let's free it explicitly and give the GValue a copy to be safe */ str = goTableModel_do_get_value(t->gotable, (gint) iter->user_data, column); /* value is uninitialized */ - /* TODO add support for multiple types */ g_value_init(value, G_TYPE_STRING); g_value_set_string(value, str); free(str);