summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redo/container_windows.go8
-rw-r--r--redo/tab_windows.go7
2 files changed, 11 insertions, 4 deletions
diff --git a/redo/container_windows.go b/redo/container_windows.go
index b79a79f..b484094 100644
--- a/redo/container_windows.go
+++ b/redo/container_windows.go
@@ -57,6 +57,14 @@ func (c *container) move(r *C.RECT) {
C.moveWindow(c.hwnd, C.int(r.left), C.int(r.top), C.int(r.right - r.left), C.int(r.bottom - r.top))
}
+func (c *container) show() {
+ C.ShowWindow(c.hwnd, C.SW_SHOW)
+}
+
+func (c *container) hide() {
+ C.ShowWindow(c.hwnd, C.SW_HIDE)
+}
+
//export storeContainerHWND
func storeContainerHWND(data unsafe.Pointer, hwnd C.HWND) {
c := (*container)(data)
diff --git a/redo/tab_windows.go b/redo/tab_windows.go
index c16cdb4..4eb960d 100644
--- a/redo/tab_windows.go
+++ b/redo/tab_windows.go
@@ -44,8 +44,7 @@ func (t *tab) Append(name string, control Control) {
}
// initially hide tab 1..n controls; if we don't, they'll appear over other tabs, resulting in weird behavior
if len(t.tabs) != 1 {
- // TODO move these calls to container itself
- C.ShowWindow(t.tabs[len(t.tabs) - 1].hwnd, C.SW_HIDE)
+ t.tabs[len(t.tabs) - 1].hide()
}
C.tabAppend(t._hwnd, toUTF16(name))
}
@@ -53,13 +52,13 @@ func (t *tab) Append(name string, control Control) {
//export tabChanging
func tabChanging(data unsafe.Pointer, current C.LRESULT) {
t := (*tab)(data)
- C.ShowWindow(t.tabs[int(current)].hwnd, C.SW_HIDE)
+ t.tabs[int(current)].hide()
}
//export tabChanged
func tabChanged(data unsafe.Pointer, new C.LRESULT) {
t := (*tab)(data)
- C.ShowWindow(t.tabs[int(new)].hwnd, C.SW_SHOW)
+ t.tabs[int(new)].show()
}
func (t *tab) hwnd() C.HWND {