2014-07-30 01:06:01 -05:00
|
|
|
// 30 july 2014
|
|
|
|
|
|
|
|
package ui
|
|
|
|
|
2014-07-30 11:36:00 -05:00
|
|
|
// 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
|
|
|
|
controlSizing
|
|
|
|
}
|
|
|
|
|
2014-08-03 08:18:35 -05:00
|
|
|
// 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,
|
|
|
|
}}
|
2014-07-30 19:38:01 -05:00
|
|
|
}
|