summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-03 22:57:28 -0600
committerJeff Carr <[email protected]>2024-01-03 22:57:28 -0600
commit3f7cca35f3889a7174e852af5a9edbe10b7b51fb (patch)
treeb7383919cf87bada5bd107d9c079fe3c8d727737 /README.md
parent60ede602fc0385ceb82da82d9cc359fc593d34d5 (diff)
TODO: make the docs correct at pkg.go.devv0.10.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 4 insertions, 15 deletions
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")
})