summaryrefslogtreecommitdiff
path: root/redo/window.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-22 00:07:41 -0400
committerPietro Gagliardi <[email protected]>2014-07-22 00:07:41 -0400
commite989c953fa683c56d9214e24c9f1fd22027afa9c (patch)
treee95ca30ddb8108e35ab5b348f9cac4dec56371ed /redo/window.go
parentde92b822a744be07d0e6424481a0f0a5280a2d4b (diff)
Moved Window.SetControl() into window.go pending addition of fake resize events.
Diffstat (limited to 'redo/window.go')
-rw-r--r--redo/window.go14
1 files changed, 14 insertions, 0 deletions
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
+}