forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.go
More file actions
25 lines (20 loc) · 675 Bytes
/
widget.go
File metadata and controls
25 lines (20 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package fyne
import "image/color"
// Widget defines the standard behaviours of any widget. This extends the
// CanvasObject - a widget behaves in the same basic way but will encapsulate
// many child objects to create the rendered widget.
type Widget interface {
CanvasObject
CreateRenderer() WidgetRenderer
}
// WidgetRenderer defines the behaviour of a widget's implementation.
// This is returned from a widget's declarative object through the Render()
// function and should be exactly one instance per widget in memory.
type WidgetRenderer interface {
Layout(Size)
MinSize() Size
Refresh()
BackgroundColor() color.Color
Objects() []CanvasObject
Destroy()
}