コード例 #1
0
ファイル: table_windows.go プロジェクト: NotBadPad/ui
//export tableSetHot
func tableSetHot(data unsafe.Pointer, row C.int, col C.int) {
	t := (*table)(data)
	redraw := (row != t.hotrow || col != t.hotcol)
	t.hotrow = row
	t.hotcol = col
	if redraw {
		C.tableUpdate(t._hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
	}
}
コード例 #2
0
ファイル: table_darwin.go プロジェクト: sjn1978/ui
func (t *table) Unlock() {
	t.unlock()
	// there's a possibility that user actions can happen at this point, before the view is updated
	// alas, this is something we have to deal with, because Unlock() can be called from any thread
	go func() {
		Do(func() {
			t.RLock()
			defer t.RUnlock()
			C.tableUpdate(t.id)
		})
	}()
}
コード例 #3
0
ファイル: table_windows.go プロジェクト: NotBadPad/ui
func (t *table) Unlock() {
	t.unlock()
	// there's a possibility that user actions can happen at this point, before the view is updated
	// alas, this is something we have to deal with, because Unlock() can be called from any thread
	go func() {
		Do(func() {
			t.RLock()
			defer t.RUnlock()
			C.tableUpdate(t._hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
		})
	}()
}
コード例 #4
0
ファイル: table_windows.go プロジェクト: NotBadPad/ui
//export tablePushed
func tablePushed(data unsafe.Pointer, row C.int, col C.int) {
	t := (*table)(data)
	t.pushedrow = row
	t.pushedcol = col
	C.tableUpdate(t._hwnd, C.int(reflect.Indirect(reflect.ValueOf(t.data)).Len()))
}