From acdea005c009afd23638cc640275166887622bef Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 11 Aug 2018 22:04:13 -0400 Subject: [PATCH] And readded some helper code for the containers. --- control.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/control.go b/control.go index 0762542..03cf181 100644 --- a/control.go +++ b/control.go @@ -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)