From e989c953fa683c56d9214e24c9f1fd22027afa9c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 22 Jul 2014 00:07:41 -0400 Subject: Moved Window.SetControl() into window.go pending addition of fake resize events. --- redo/window.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'redo/window.go') diff --git a/redo/window.go b/redo/window.go index 2bb3784..143a875 100644 --- a/redo/window.go +++ b/redo/window.go @@ -34,3 +34,17 @@ type Window interface { func NewWindow(title string, width int, height int) Window { return newWindow(title, width, height) } + +// everything below is kept here because they're the same on all platforms +// TODO move event stuff here and make windowbase + +func (w *window) SetControl(control Control) { + if w.child != nil { // unparent existing control + w.child.unparent() + } + control.unparent() + control.parent(w) + w.child = control + // TODO trigger a resize to let the new control actually be shown + // TODO do the same with control's old parent, if any +} -- cgit v1.2.3