Added basic control showing to the Windows backend.
This commit is contained in:
parent
d6a8a72662
commit
d154a2d74d
|
@ -19,7 +19,8 @@ func newWidget(class *uint16, style uintptr, extstyle uintptr) *widgetbase {
|
||||||
class, emptystr,
|
class, emptystr,
|
||||||
style | c_WS_CHILD | c_WS_VISIBLE,
|
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,
|
// c_CW_USEDEFAULT, c_CW_USEDEFAULT,
|
||||||
|
100,100,
|
||||||
// the following has the consequence of making the control message-only at first
|
// the following has the consequence of making the control message-only at first
|
||||||
// this shouldn't cause any problems... hopefully not
|
// this shouldn't cause any problems... hopefully not
|
||||||
// but see the msgwndproc() for caveat info
|
// but see the msgwndproc() for caveat info
|
||||||
|
|
|
@ -12,6 +12,8 @@ type window struct {
|
||||||
hwnd uintptr
|
hwnd uintptr
|
||||||
shownbefore bool
|
shownbefore bool
|
||||||
|
|
||||||
|
child Control
|
||||||
|
|
||||||
closing *event
|
closing *event
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +67,12 @@ func (w *window) SetControl(control Control) *Request {
|
||||||
c := make(chan interface{})
|
c := make(chan interface{})
|
||||||
return &Request{
|
return &Request{
|
||||||
op: func() {
|
op: func() {
|
||||||
// TODO unparent
|
if w.child != nil { // unparent existing control
|
||||||
// TODO reparent
|
w.child.unparent()
|
||||||
|
}
|
||||||
|
control.unparent()
|
||||||
|
control.parent(w)
|
||||||
|
w.child = control
|
||||||
c <- struct{}{}
|
c <- struct{}{}
|
||||||
},
|
},
|
||||||
resp: c,
|
resp: c,
|
||||||
|
|
Loading…
Reference in New Issue