More TODO/future plan separation.

This commit is contained in:
Pietro Gagliardi 2014-08-08 20:14:25 -04:00
parent 79ada1bdaa
commit 3200a0ca97
5 changed files with 10 additions and 7 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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 {

View File

@ -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;

View File

@ -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);