diff options
| author | Clement Benard <contact@clementbenard.com> | 2019-07-12 17:23:28 +0200 |
|---|---|---|
| committer | Clement Benard <contact@clementbenard.com> | 2019-07-12 17:23:28 +0200 |
| commit | 0cc6367a881ab7dba48ace7b111e0eb1151c10bb (patch) | |
| tree | eabadd10783b857271f12797f1a505efec85630c /layout/layout.go | |
| parent | 009f865bc5484e54f09d2173b2b3dbbf3838d391 (diff) | |
| download | gui-0cc6367a881ab7dba48ace7b111e0eb1151c10bb.zip | |
Better separation between Layout and Mux
Diffstat (limited to 'layout/layout.go')
| -rw-r--r-- | layout/layout.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/layout/layout.go b/layout/layout.go index 987ee24..dfacca1 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -3,17 +3,22 @@ package layout import ( "image" "image/draw" + + "github.com/faiface/gui" ) // Layout represents any graphical layout // -// A Layout needs to be able to redraw itself with the Redraw method. -// Redraw() only draws the background or frame of the Layout, not the childs. +// Items returns the Layout's childs in whatever order. // // Lay represents the way to divide space among your childs. // It takes a parameter of how much space is available, // and returns where exactly to put its childs. +// The order must be the same as Items. +// +// Redraw only draws the background or frame of the Layout, not the childs. type Layout interface { + Items() []*gui.Env Lay(image.Rectangle) []image.Rectangle Redraw(draw.Image, image.Rectangle) } |