summaryrefslogtreecommitdiff
path: root/redo/controls_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-22 17:45:29 -0400
committerPietro Gagliardi <[email protected]>2014-07-22 17:45:29 -0400
commite9c6d96d2da8311969870335850bd88ec899e813 (patch)
tree5c6e1d8a6eeb456b6c2788cf9d671c083c9ae635 /redo/controls_darwin.go
parente989c953fa683c56d9214e24c9f1fd22027afa9c (diff)
Added provisions for proper window redraw on Window.SetParent() and implemented them on Mac OS X; still untested.
Diffstat (limited to 'redo/controls_darwin.go')
-rw-r--r--redo/controls_darwin.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/redo/controls_darwin.go b/redo/controls_darwin.go
index 92eb836..6d5edf8 100644
--- a/redo/controls_darwin.go
+++ b/redo/controls_darwin.go
@@ -11,7 +11,7 @@ import "C"
type widgetbase struct {
id C.id
- parentw *window
+ notnew bool // to prevent unparenting a new control
floating bool
}
@@ -24,17 +24,18 @@ func newWidget(id C.id) *widgetbase {
// these few methods are embedded by all the various Controls since they all will do the same thing
func (w *widgetbase) unparent() {
- if w.parentw != nil {
+ if w.notnew {
+ // redrawing the old window handled by C.unparent()
C.unparent(w.id)
w.floating = true
- w.parentw = nil
}
}
func (w *widgetbase) parent(win *window) {
+ // redrawing the new window handled by C.parent()
C.parent(w.id, win.id, toBOOL(w.floating))
w.floating = false
- w.parentw = win
+ w.notnew = true
}
type button struct {