And readded some helper code for the containers.
This commit is contained in:
parent
c05fc0d645
commit
acdea005c0
|
@ -18,6 +18,11 @@ var controls = make(map[*C.uiControl]Control)
|
||||||
// The preferred way to create new Controls is to use
|
// The preferred way to create new Controls is to use
|
||||||
// ControlBase; see ControlBase below.
|
// ControlBase; see ControlBase below.
|
||||||
type Control interface {
|
type Control interface {
|
||||||
|
// LibuiControl returns the uiControl pointer for the Control.
|
||||||
|
// This is intended for use when adding a control to a
|
||||||
|
// container.
|
||||||
|
LibuiControl() uintptr
|
||||||
|
|
||||||
// Destroy destroys the Control.
|
// Destroy destroys the Control.
|
||||||
Destroy()
|
Destroy()
|
||||||
|
|
||||||
|
@ -82,6 +87,10 @@ func NewControlBase(iface Control, c uintptr) ControlBase {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ControlBase) LibuiControl() uintptr {
|
||||||
|
return uintptr(unsafe.Pointer(c.c))
|
||||||
|
}
|
||||||
|
|
||||||
func (c *ControlBase) Destroy() {
|
func (c *ControlBase) Destroy() {
|
||||||
delete(controls, c.c)
|
delete(controls, c.c)
|
||||||
C.uiControlDestroy(c.c)
|
C.uiControlDestroy(c.c)
|
||||||
|
|
Loading…
Reference in New Issue