From eef3e1136b51112c23620b150ffcf03caddc0ff9 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 14 Oct 2014 15:17:35 -0400 Subject: Started the new recontainerization.. --- newctrl/control.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 newctrl/control.go (limited to 'newctrl/control.go') diff --git a/newctrl/control.go b/newctrl/control.go new file mode 100644 index 0000000..028b195 --- /dev/null +++ b/newctrl/control.go @@ -0,0 +1,29 @@ +// 30 july 2014 + +package ui + +// Control represents a control. +type Control interface { + setParent(p *controlParent) // controlParent defined per-platform +// nChildren() int // TODO + preferredSize(d *sizing) (width, height int) + resize(x int, y int, width int, height int, d *sizing) +} + +type controlbase struct { + fsetParent func(p *controlParent) + fpreferredSize func(d *sizing) (width, height int) + fresize func(x int, y int, width int, height int, d *sizing) +} + +func (c *controlbase) setParent(p *controlParent) { + c.fsetParent(p) +} + +func (c *controlbase) preferredSize(d *sizing) (width, height int) { + return c.fpreferredSize(d) +} + +func (c *controlbase) resize(x int, y int, width int, height int, d *sizing) { + c.fresize(x, y, width, height, d) +} -- cgit v1.2.3