From d154a2d74d01be34561b2959864ce9302043c27f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 15 Jul 2014 22:44:27 -0400 Subject: [PATCH] Added basic control showing to the Windows backend. --- redo/controls_windows.go | 3 ++- redo/window_windows.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/redo/controls_windows.go b/redo/controls_windows.go index b661b99..3b73b48 100644 --- a/redo/controls_windows.go +++ b/redo/controls_windows.go @@ -19,7 +19,8 @@ func newWidget(class *uint16, style uintptr, extstyle uintptr) *widgetbase { class, emptystr, style | c_WS_CHILD | c_WS_VISIBLE, c_CW_USEDEFAULT, c_CW_USEDEFAULT, - c_CW_USEDEFAULT, c_CW_USEDEFAULT, +// c_CW_USEDEFAULT, c_CW_USEDEFAULT, +100,100, // the following has the consequence of making the control message-only at first // this shouldn't cause any problems... hopefully not // but see the msgwndproc() for caveat info diff --git a/redo/window_windows.go b/redo/window_windows.go index 4fb971f..14fa352 100644 --- a/redo/window_windows.go +++ b/redo/window_windows.go @@ -12,6 +12,8 @@ type window struct { hwnd uintptr shownbefore bool + child Control + closing *event } @@ -65,8 +67,12 @@ func (w *window) SetControl(control Control) *Request { c := make(chan interface{}) return &Request{ op: func() { - // TODO unparent - // TODO reparent + if w.child != nil { // unparent existing control + w.child.unparent() + } + control.unparent() + control.parent(w) + w.child = control c <- struct{}{} }, resp: c,