From 0c3ed55c33f1ce18c8d1797ade708b143589a8dc Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 19 Jan 2024 12:39:25 -0600 Subject: better name Signed-off-by: Jeff Carr --- basicWindow.go | 40 ---------------------------------------- stateWindow.go | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 40 deletions(-) delete mode 100644 basicWindow.go create mode 100644 stateWindow.go diff --git a/basicWindow.go b/basicWindow.go deleted file mode 100644 index 220ef52..0000000 --- a/basicWindow.go +++ /dev/null @@ -1,40 +0,0 @@ -// This creates a simple hello world window -package main - -import ( - "go.wit.com/gui" - "go.wit.com/lib/gadgets" - "go.wit.com/log" -) - -var apple *gui.Node - -// This initializes the first window, a group and a button -func makebasicWindow() *gadgets.BasicWindow { - log.Warn("start basicWindow") - basicWindow = gadgets.NewBasicWindow(myGui, "basic window test") - basicWindow.Make() - basicWindow.StandardClose() - basicWindow.Custom = func() { - log.Warn("got to close") - } - - box1 := basicWindow.Box() - group1 := box1.NewGroup("choices") - group1.NewButton("hide apple", func() { - apple.Hide() - }) - group1.NewButton("show apple", func() { - apple.Show() - }) - group1.NewButton("hide computers", func() { - computers.Hide() - }) - group1.NewButton("show computers", func() { - computers.Show() - }) - apple = group1.NewButton("apple", func() { - log.Info("is not a pear") - }) - return basicWindow -} diff --git a/stateWindow.go b/stateWindow.go new file mode 100644 index 0000000..74954da --- /dev/null +++ b/stateWindow.go @@ -0,0 +1,41 @@ +// This window, when it's hidden, still exists to the application +// so it can be treated as if it really exists +package main + +import ( + "go.wit.com/gui" + "go.wit.com/lib/gadgets" + "go.wit.com/log" +) + +var apple *gui.Node + +// This initializes the first window, a group and a button +func makebasicWindow() *gadgets.BasicWindow { + log.Warn("start basicWindow") + basicWindow = gadgets.NewBasicWindow(myGui, "basic window test") + basicWindow.Make() + basicWindow.StandardClose() + basicWindow.Custom = func() { + log.Warn("got to close") + } + + box1 := basicWindow.Box() + group1 := box1.NewGroup("choices") + group1.NewButton("hide apple", func() { + apple.Hide() + }) + group1.NewButton("show apple", func() { + apple.Show() + }) + group1.NewButton("hide computers", func() { + computers.Hide() + }) + group1.NewButton("show computers", func() { + computers.Show() + }) + apple = group1.NewButton("apple", func() { + log.Info("is not a pear") + }) + return basicWindow +} -- cgit v1.2.3