diff options
| author | Jeff Carr <[email protected]> | 2019-05-12 18:17:12 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-05-12 18:17:12 -0700 |
| commit | 27b26ea5b7f3f0c89dab639fc5b04cc3a57f60cd (patch) | |
| tree | 6c340591a16b51f485b62c70510c6da1628d6cd3 /demo.go | |
| parent | b92903ad1507c44e218d5887fb5229fab82f5dd2 (diff) | |
move sample code into appropriate files
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'demo.go')
| -rw-r--r-- | demo.go | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -0,0 +1,40 @@ +package gui + +import "log" + +import "github.com/andlabs/ui" +import _ "github.com/andlabs/ui/winmanifest" + +var demowin *ui.Window +var demotab *ui.Tab + +func setupDemoUI() { + log.Println("setupDemoUI() START") + demowin = ui.NewWindow("Demo GUI Widgets", 500, 300, false) + demowin.OnClosing(func(*ui.Window) bool { + ui.Quit() + return true + }) + ui.OnShouldQuit(func() bool { + demowin.Destroy() + return true + }) + + demotab = ui.NewTab() + demowin.SetChild(demotab) + demowin.SetMargined(true) + + demotab.Append("List examples", makeNumbersPage()) + tabcount := 0 + demotab.SetMargined(tabcount, true) + + demotab.Append("Choosers examples", makeDataChoosersPage()) + tabcount += 1 + demotab.SetMargined(tabcount, true) + + demotab.Append("Group examples", makeGroupEntries()) + tabcount += 1 + demotab.SetMargined(tabcount, true) + + demowin.Show() +} |
