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 /examples/layout/card.go | |
| parent | 8b70878ccc7fe324f3647e56503a37f3780f9d41 (diff) | |
| download | gui-8d183ef96a57e3a2f42c0cb4ec0ab4c256e0d47e.zip | |
Made the layout package actually usable
Diffstat (limited to 'examples/layout/card.go')
| -rw-r--r-- | examples/layout/card.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/layout/card.go b/examples/layout/card.go new file mode 100644 index 0000000..501e4e3 --- /dev/null +++ b/examples/layout/card.go @@ -0,0 +1,24 @@ +package main + +import ( + "github.com/faiface/gui" + "github.com/faiface/gui/layout" + "golang.org/x/image/colornames" +) + +func Card(env gui.Env, theme *Theme, title, content string) { + box := layout.Grid{ + Rows: []int{1, 1}, + // Flip: true, + // Gap: 4, + Background: colornames.Pink, + } + fields := makeEnvPtr(2) + layout.NewMux(env, + fields, + box, + ) + go Label(*fields[0], theme, title, colornames.Lightgray) + go Label(*fields[1], theme, content, colornames.Slategray) + // go Blinker(*fields[1]) +} |