diff options
| author | Jeff Carr <[email protected]> | 2024-01-21 01:57:04 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-21 01:57:04 -0600 | 
| commit | 05634894d449b016c93331847e6c824bf6b0cd2f (patch) | |
| tree | 455562e0df171f41d54e59f44363bd64adf50b05 | |
| parent | ff5892537cc17b731ded5a99defaddaf4adc5a49 (diff) | |
screwed up things with window displayv0.0.2
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | main.go | 42 | 
2 files changed, 24 insertions, 21 deletions
@@ -2,6 +2,9 @@ all:  	go build -v -x  	./control-panel-vpn +goimports: +	goimports -w *.go +  redomod:  	rm -f go.*  	GO111MODULE= go mod init @@ -1,19 +1,27 @@  // This is a simple example  package main -import 	( -	"log" -	"go.wit.com/gui/gui" -	"go.wit.com/gui/gadgets" -	"go.wit.com/apps/control-panel-dns/smartwindow" +import ( +	"go.wit.com/log" + +	"go.wit.com/gui" +	"go.wit.com/lib/gadgets"  )  var myGui *gui.Node +var win *gadgets.BasicWindow +  func main() {  	myGui = gui.New().Default() - +	myGui.LoadToolkit("andlabs")  	helloworld() +	log.Sleep(1) +	win.Toggle() +	log.Sleep(1) +	win.Toggle() +	log.Sleep(1) +	win.Toggle()  	// This is just a optional goroutine to watch that things are alive  	gui.Watchdog() @@ -21,9 +29,11 @@ func main() {  // This creates a window  func helloworld() { -	win := gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window") +	win = gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window") +	win.Make() +	win.Draw() -	win.Box().NewButton("hello", func () { +	win.Box().NewButton("hello", func() {  		log.Println("world")  		hellosmart()  	}) @@ -31,21 +41,11 @@ func helloworld() {  // This creates a window  func hellosmart() { -	win := smartwindow.New() -	win.SetParent(myGui) -	win.InitWindow() -	win.Title("helloworld golang wit/gui window") -	win.Vertical() -	win.SetDraw(smartDraw) +	win := gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window")  	win.Make() +	win.Draw() -	win.Box().NewButton("hello", func () { -		log.Println("smart") -	}) -} - -func smartDraw(sw *smartwindow.SmartWindow) { -	sw.Box().NewButton("hello", func () { +	win.Box().NewButton("hello", func() {  		log.Println("smart")  	})  }  | 
