diff options
| author | Clement Benard <contact@clementbenard.com> | 2019-08-07 16:02:33 +0200 |
|---|---|---|
| committer | Clement Benard <contact@clementbenard.com> | 2019-08-07 16:02:33 +0200 |
| commit | 8d183ef96a57e3a2f42c0cb4ec0ab4c256e0d47e (patch) | |
| tree | 4fa644f93ceeb5c102c5c1dcf85105890c0cf25b /layout/layout.go | |
| parent | 8b70878ccc7fe324f3647e56503a37f3780f9d41 (diff) | |
| download | gui-8d183ef96a57e3a2f42c0cb4ec0ab4c256e0d47e.zip | |
Made the layout package actually usable
Diffstat (limited to 'layout/layout.go')
| -rw-r--r-- | layout/layout.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/layout/layout.go b/layout/layout.go index 8b8e039..4d8e616 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -2,7 +2,6 @@ package layout import ( "image" - "image/draw" ) // Layout represents any graphical layout @@ -10,10 +9,12 @@ import ( // 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. +// Intercept transforms an Env channel to another. +// This way the Layout can emit its own Events, re-emit previous ones, +// or even stop an event from propagating, think win.MoScroll. +// It can be a no-op. type Layout interface { Lay(image.Rectangle) []image.Rectangle - Redraw(draw.Image, image.Rectangle) + Intercepter } |