From 92db003be0f8835ae0621b546ff7b40446e1b522 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 3 Jan 2024 22:57:28 -0600 Subject: [PATCH] TODO: make the docs correct at pkg.go.dev Signed-off-by: Jeff Carr --- Makefile | 2 +- README.md | 19 ++++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 59328a0..97f87bf 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ git.wit.org: # sync repo to the github backup # git remote add github git@github.com:wit-go/gui.git -github: +github: git.wit.org git push origin master git push origin devel git push origin --tags diff --git a/README.md b/README.md index 26ec09a..dfe7857 100644 --- a/README.md +++ b/README.md @@ -41,29 +41,18 @@ import ( "go.wit.com/wit/gui/gui" ) -var window *gui.Node // This is the beginning of the binary tree of widgets +var myGui *gui.Node // This is your gui object // go will sit here until the window exits func main() { - gui.Init() - gui.Main(helloworld) + myGui = gui.Init() } // This initializes the first window and 2 tabs func helloworld() { - gui.Config.Title = "Hello World golang wit/gui Window" - gui.Config.Width = 640 - gui.Config.Height = 480 + window := myGui.NewWindow() - window := gui.NewWindow() - addTab(window, "A Simple Tab Demo") - addTab(window, "A Second Tab") -} - -func addTab(w *gui.Node, title string) { - tab := w.NewTab(title) - - group := tab.NewGroup("foo bar") + group := window.NewGroup("foo bar") group.NewButton("hello", func() { log.Println("world") })