From 057f0eaf53f2f7f40113e4a0952750d85f689521 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 25 Jun 2014 22:17:26 -0400 Subject: Migrated existing controls to the new sizing system. --- checkbox.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'checkbox.go') diff --git a/checkbox.go b/checkbox.go index 71c2b77..1f2ea58 100644 --- a/checkbox.go +++ b/checkbox.go @@ -70,16 +70,24 @@ func (c *Checkbox) make(window *sysData) error { return nil } -func (c *Checkbox) setRect(x int, y int, width int, height int, rr *[]resizerequest) { - *rr = append(*rr, resizerequest{ - sysData: c.sysData, +func (c *Checkbox) allocate(x int, y int, width int, height int, d *sysSizeData) []*allocation { + return []*allocation{&allocation{ x: x, y: y, width: width, height: height, - }) + this: c, + }} } -func (c *Checkbox) preferredSize() (width int, height int, yoff int) { - return c.sysData.preferredSize() +func (c *Checkbox) preferredSize(d *sysSizeData) (width int, height int) { + return c.sysData.preferredSize(d) +} + +func (c *Checkbox) commitResize(a *allocation, d *sysSizeData) { + c.sysData.preferredSize(a, d) +} + +func (c *Checkbox) getAuxResizeInfo(d *sysSizeData) { + c.sysData.getAuxResizeInfo(d) } -- cgit v1.2.3