summaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-05 12:46:17 -0600
committerJeff Carr <[email protected]>2024-01-05 12:46:17 -0600
commit0993e7d3d06186eac45ad34fd8618565219032ed (patch)
treea9e7bb68dd0cf205af0cf970082b8eee7f620228 /doc.go
parent6f566c0051e9627a7560b9e38ab860ae8a0940c3 (diff)
Tabs are Windows
Tabs don't exist. The are simply windows within a window. There are *lots* of problems with trying to treat everything that way. Luckily, we don't have to care. All the problems with handling that concept can be pushed to the toolkits/ therefore, this primitive code can be kept as clean as possible Makefile and git cleanups Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'doc.go')
-rw-r--r--doc.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/doc.go b/doc.go
index c68b0ae..e8f94db 100644
--- a/doc.go
+++ b/doc.go
@@ -41,20 +41,16 @@ Hello World Example
// go will sit here until the window exits
func main() {
- myGui = gui.New()
+ myGui = gui.New().Default()
+
+ helloworld()
}
- // This initializes the first window and 2 tabs
+ // This initializes the first window, a group and a button
func helloworld() {
window := myGui.NewWindow("hello world")
- 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")
})