summaryrefslogtreecommitdiff
path: root/redo/table_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-29 03:43:01 -0400
committerPietro Gagliardi <[email protected]>2014-07-29 03:43:01 -0400
commitabb77b7a5cf79f05bf50ec930d29241299d48ad9 (patch)
treedc8b80be755d98e810cc8c4a8d45e8f21989cce8 /redo/table_unix.go
parentf099d935ea2ef9ced0520ea511991a7a0e145eda (diff)
Hooked all the GTK+ Table stuff together and got it working. Woo!
Diffstat (limited to 'redo/table_unix.go')
-rw-r--r--redo/table_unix.go13
1 files changed, 12 insertions, 1 deletions
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