summaryrefslogtreecommitdiff
path: root/redo/controls_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-25 17:34:45 -0400
committerPietro Gagliardi <[email protected]>2014-07-25 17:34:45 -0400
commit4680e35300544a90d5426cbf44b4c533fa025105 (patch)
tree3242d6b03f2171d7090fd3a6e8383be99867f43f /redo/controls_windows.go
parentd03b8f4b7ce5cc04753679798e14233135026a25 (diff)
Simplified the control nesting model by removing Control.unparent() and requiring all Windows to have a Control at construct time; implemented such on Windows.
Diffstat (limited to 'redo/controls_windows.go')
-rw-r--r--redo/controls_windows.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/redo/controls_windows.go b/redo/controls_windows.go
index c517074..68ea05b 100644
--- a/redo/controls_windows.go
+++ b/redo/controls_windows.go
@@ -11,6 +11,7 @@ import "C"
type widgetbase struct {
hwnd C.HWND
+ parent C.HWND
}
func newWidget(class C.LPCWSTR, style C.DWORD, extstyle C.DWORD) *widgetbase {
@@ -21,13 +22,9 @@ func newWidget(class C.LPCWSTR, style C.DWORD, extstyle C.DWORD) *widgetbase {
// these few methods are embedded by all the various Controls since they all will do the same thing
-func (w *widgetbase) unparent() {
- C.controlSetParent(w.hwnd, C.msgwin)
-}
-
-func (w *widgetbase) parent(win *window) {
- C.controlSetParent(w.hwnd, win.hwnd)
- // TODO new control does not show up until window is resized
+func (w *widgetbase) setParent(win C.HWND) {
+ C.controlSetParent(w.hwnd, win)
+ w.parent = win
}
func (w *widgetbase) containerShow() {