summaryrefslogtreecommitdiff
path: root/cmds/buttonplugin/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-27 20:41:53 -0500
committerJeff Carr <[email protected]>2023-04-27 20:41:53 -0500
commit9e285c7affa3257a46e85acde6dc64a9c781b728 (patch)
tree7e957fc0b5f6e631e762baffe292828e318e0910 /cmds/buttonplugin/main.go
parent6f441738061b0528e86183402474ddb1cdf3c77a (diff)
gocui: grid width fixed
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds/buttonplugin/main.go')
-rw-r--r--cmds/buttonplugin/main.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmds/buttonplugin/main.go b/cmds/buttonplugin/main.go
index 7ced40b..4b6a2ff 100644
--- a/cmds/buttonplugin/main.go
+++ b/cmds/buttonplugin/main.go
@@ -13,6 +13,8 @@ var outfile string = "/tmp/guilogfile"
var myGui *gui.Node
var buttonCounter int = 5
+var gridW int = 5
+var gridH int = 2
func main() {
// This will turn on all debugging
@@ -20,7 +22,12 @@ func main() {
// myGui = gui.New().LoadToolkit("gocui")
// myGui = gui.New().LoadToolkit("andlabs")
- myGui = gui.New().Default()
+ // myGui = gui.New().Default()
+ if (args.GuiToolkit == nil) {
+ myGui = gui.New().Default()
+ } else {
+ myGui = gui.New().LoadToolkit(args.GuiToolkit[0])
+ }
buttonWindow()
// This is just a optional goroutine to watch that things are alive
@@ -42,7 +49,7 @@ func buttonWindow() {
g1.NewButton("hello2", func () {
log.Println("world2")
})
- more2 = g1.NewGrid("gridnuts", 3, 3)
+ more2 = g1.NewGrid("gridnuts", gridW, gridH)
more2.NewLabel("more2")