diff options
| author | Pietro Gagliardi <[email protected]> | 2018-08-11 22:04:13 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2018-08-11 22:04:13 -0400 |
| commit | acdea005c009afd23638cc640275166887622bef (patch) | |
| tree | bc801c8c3d2c7deeb3c32c440fddff63883474da | |
| parent | c05fc0d645e64d93700fde886c4af322544e03e5 (diff) | |
And readded some helper code for the containers.
| -rw-r--r-- | control.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -18,6 +18,11 @@ var controls = make(map[*C.uiControl]Control) // The preferred way to create new Controls is to use // ControlBase; see ControlBase below. 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() @@ -82,6 +87,10 @@ func NewControlBase(iface Control, c uintptr) ControlBase { return b } +func (c *ControlBase) LibuiControl() uintptr { + return uintptr(unsafe.Pointer(c.c)) +} + func (c *ControlBase) Destroy() { delete(controls, c.c) C.uiControlDestroy(c.c) |
