summaryrefslogtreecommitdiff
path: root/redo/control.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-07-30 20:38:01 -0400
committerPietro Gagliardi <[email protected]>2014-07-30 20:38:01 -0400
commitc5917de29c5452b4ff11441fe353fe46984caa4f (patch)
tree743b61a7d435e8d78cef0616a7007e597704f403 /redo/control.go
parent713be62f16b2f621eb104a1ba916ef5b1781eecc (diff)
Split out the default definitions of Control.allocate() into a single place.
Diffstat (limited to 'redo/control.go')
-rw-r--r--redo/control.go13
1 files changed, 13 insertions, 0 deletions
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,
+ }}
+ }
+}