summaryrefslogtreecommitdiff
path: root/examples.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-22 18:35:00 -0700
committerJeff Carr <[email protected]>2019-05-22 18:35:00 -0700
commit522581dbafc487a8b6a049e22522233504bdf829 (patch)
tree233548feacd4562dd7014e9f1307943d880f3434 /examples.go
parent5c07e5f605cb74ed0a1504e2386ba565f37b49f4 (diff)
I guess all GUI stuff must go in here. No other goroutine can ever
interact with the GUI or Windows cross platform support breaks. Lame Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'examples.go')
-rw-r--r--examples.go20
1 files changed, 4 insertions, 16 deletions
diff --git a/examples.go b/examples.go
index df9c5b5..3d6c904 100644
--- a/examples.go
+++ b/examples.go
@@ -1,35 +1,23 @@
package gui
-import "log"
+// import "log"
-import "github.com/gookit/config"
+// import "github.com/gookit/config"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
-import "github.com/davecgh/go-spew/spew"
+// import "github.com/davecgh/go-spew/spew"
var jcarrButton *ui.Button
var jcarrEntry *ui.MultilineEntry
-func buttonClick(button *ui.Button) {
- log.Println("hostname =", config.String("hostname"), button)
- spew.Dump(button)
- if (jcarrButton == button) {
- log.Println("This is the jcarrButton")
- cur := jcarrEntry.Text()
- jcarrEntry.SetText(cur + "THIS IS A GREAT IDEA\n")
- } else {
- log.Println("This is NOT the jcarrButton")
- }
-}
-
func hostnameButton(hostname string) ui.Control {
tmpbox := ui.NewHorizontalBox()
tmpbox.SetPadded(true)
tmpButton := ui.NewButton(hostname)
tmpbox.Append(tmpButton, false)
- tmpButton.OnClicked(buttonClick)
+ tmpButton.OnClicked(defaultButtonClick)
jcarrButton = tmpButton