diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-25 17:34:45 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-25 17:34:45 -0400 |
| commit | 4680e35300544a90d5426cbf44b4c533fa025105 (patch) | |
| tree | 3242d6b03f2171d7090fd3a6e8383be99867f43f /redo/window_windows.go | |
| parent | d03b8f4b7ce5cc04753679798e14233135026a25 (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/window_windows.go')
| -rw-r--r-- | redo/window_windows.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/redo/window_windows.go b/redo/window_windows.go index 43a7631..1ac294a 100644 --- a/redo/window_windows.go +++ b/redo/window_windows.go @@ -35,7 +35,11 @@ func makeWindowWindowClass() error { return nil } -func newWindow(title string, width int, height int) *window { +type controlParent interface { + setParent(C.HWND) +} + +func newWindow(title string, width int, height int, control Control) *window { w := &window{ // hwnd set in WM_CREATE handler closing: newEvent(), @@ -49,6 +53,8 @@ func newWindow(title string, width int, height int) *window { if hresult != C.S_OK { panic(fmt.Errorf("error setting tab background texture on Window; HRESULT: 0x%X", hresult)) } + w.child = control + w.child.setParent(w.hwnd) return w } |
