From 99de2790d59a136e7b5f158d65965375b6c5e8f7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 19 Jan 2024 00:34:15 -0600 Subject: show & hide tests Signed-off-by: Jeff Carr --- basicWindow.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'basicWindow.go') diff --git a/basicWindow.go b/basicWindow.go index c763aad..220ef52 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -2,23 +2,39 @@ package main import ( - "go.wit.com/log" + "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 () { + basicWindow.Custom = func() { log.Warn("got to close") } box1 := basicWindow.Box() group1 := box1.NewGroup("choices") - group1.NewButton("hello", func() {}) - // basicWindow.Draw() + 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