From c5917de29c5452b4ff11441fe353fe46984caa4f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 30 Jul 2014 20:38:01 -0400 Subject: Split out the default definitions of Control.allocate() into a single place. --- redo/control.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'redo/control.go') diff --git a/redo/control.go b/redo/control.go index 8174ad7..0b88533 100644 --- a/redo/control.go +++ b/redo/control.go @@ -54,3 +54,16 @@ func (w *controldefs) commitResize(c *allocation, d *sizing) { func (w *controldefs) getAuxResizeInfo(d *sizing) { w.fgetAuxResizeInfo(d) } + +// and this is the same across all platforms +func baseallocate(c *controlbase) func(x int, y int, width int, height int, d *sizing) []*allocation { + return func(x int, y int, width int, height int, d *sizing) []*allocation { + return []*allocation{&allocation{ + x: x, + y: y, + width: width, + height: height, + this: c, + }} + } +} -- cgit v1.2.3