From abb77b7a5cf79f05bf50ec930d29241299d48ad9 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 29 Jul 2014 03:43:01 -0400 Subject: Hooked all the GTK+ Table stuff together and got it working. Woo! --- redo/table_unix.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'redo/table_unix.go') diff --git a/redo/table_unix.go b/redo/table_unix.go index 399ca3d..6ca0cec 100644 --- a/redo/table_unix.go +++ b/redo/table_unix.go @@ -13,6 +13,9 @@ import ( // #include "gtk_unix.h" import "C" +// TODOs +// - make column headers resizeable + type table struct { *widgetbase *tablebase @@ -28,6 +31,7 @@ type table struct { // stuff required by GtkTreeModel nColumns C.gint + old C.gint } func finishNewTable(b *tablebase, ty reflect.Type) Table { @@ -66,6 +70,11 @@ func (t *table) preferredSize(d *sizing) (width int, height int) { return int(r.width), int(r.height) } +func (t *table) Lock() { + t.tablebase.Lock() + d := reflect.Indirect(reflect.ValueOf(t.data)) + t.old = C.gint(d.Len()) +} func (t *table) Unlock() { t.unlock() @@ -73,7 +82,9 @@ func (t *table) Unlock() { // not sure about this one... t.RLock() defer t.RUnlock() - // TODO + d := reflect.Indirect(reflect.ValueOf(t.data)) + new := C.gint(d.Len()) + C.tableUpdate(t.model, t.old, new) } //export goTableModel_get_n_columns -- cgit v1.2.3