summaryrefslogtreecommitdiff
path: root/redo/control.go
blob: 4ba96187ddb15477f9d130682325f8dfe013fbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 30 july 2014

package ui

// Control represents a control.
// All Controls have event handlers that take a single argument (the Doer active during the event) and return nothing.
type Control interface {
	setParent(p *controlParent)	// controlParent defined per-platform
	// TODO enable/disable (public)
	controlSizing
}

// this is the same across all platforms
func baseallocate(c Control, x int, y int, width int, height int, d *sizing) []*allocation {
	return []*allocation{&allocation{
		x:		x,
		y:		y,
		width:	width,
		height:	height,
		this:		c,
	}}
}