summaryrefslogtreecommitdiff
path: root/cmds/textbox
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
committerJeff Carr <[email protected]>2023-03-23 12:35:12 -0500
commitd4787a1ebdd08359746516dbb72f1feaf95be5b6 (patch)
treecb81756d61096ccf74af7c8cc9a15e4e00fe1da7 /cmds/textbox
parent6a848bf40474365cc1c0b4da9e2f7e3e10b4d627 (diff)
Squashed commit of the following:v0.7.3
boxes now exist and are tracked in the binary tree create for group and grid works gocui plugin no longer works. TODO: fix in next release converted everything from plugin to Action() can remove send() tab and window are now action() flags moved to action() ready for new release pad() margion() border() all work move worked! go.wit.com attept 578th try adds an early grid widget. won't work until chan andlabs/ui grid (X,Y) works right actually can put things in places in a grid Queue() means shit doesn't look right on grids lots of fucking around. why am I wasting time on image? wow. the crazy doAppend() thing is gone implement Action Show() and Hide() Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds/textbox')
-rw-r--r--cmds/textbox/main.go39
1 files changed, 18 insertions, 21 deletions
diff --git a/cmds/textbox/main.go b/cmds/textbox/main.go
index 44431b7..33d0cae 100644
--- a/cmds/textbox/main.go
+++ b/cmds/textbox/main.go
@@ -20,21 +20,10 @@ var args struct {
}
func main() {
+ // this implements ./cmd --gui-debug --gui-toolkit, etc
arg.MustParse(&args)
- // fmt.Println(args.Foo, args.Bar, args.User)
log.Println("Toolkit = ", args.Toolkit)
- /*
- f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
- if err != nil {
- log.Fatalf("error opening file: %v", err)
- }
- defer f.Close()
-
- log.SetOutput(f)
- log.Println("This is a test log entry")
- */
-
// gui.InitPlugins([]string{"andlabs"})
gui.Main(initGUI)
}
@@ -52,32 +41,40 @@ func initGUI() {
log.Println("myDefaultExit(w)")
myDefaultExit(w)
}
- w.Dump()
addDemoTab(w, "A Simple Tab Demo")
addDemoTab(w, "A Second Tab")
if (args.GuiDebug) {
- gui.DebugWindow()
+ gui.DebugWindow()
}
if (args.GuiVerbose) {
- gui.SetDebug(true)
+ gui.SetDebug(true)
}
}
func addDemoTab(window *gui.Node, title string) {
- var newNode, g, g2, tb *gui.Node
+ var newNode, g *gui.Node
newNode = window.NewTab(title)
- log.Println("addDemoTab() newNode.Dump")
- newNode.Dump()
+ log.Println("addDemoTab() newNode START")
+ // newNode.Dump(true)
g = newNode.NewGroup("group 1")
- dd := g.NewDropdown("demoCombo2")
+
+ g1 := g.NewGrid("grid 1", 2, 2)
+ g1.NewLabel("less")
+ dd := g1.NewDropdown("more")
dd.AddDropdownName("more 1")
dd.AddDropdownName("more 2")
dd.AddDropdownName("more 3")
- g2 = newNode.NewGroup("group 2")
- tb = g2.NewTextbox("tb")
+
+ g.SetNext(3,1)
+ g1.NewLabel("label (3,1)")
+ g.SetNext(3,2)
+ g1.NewLabel("label (3,2)")
+
+ g2 := newNode.NewGroup("group 2")
+ tb := g2.NewTextbox("tb")
log.Println("tb =", tb.GetText())
tb.Custom = func() {
s := tb.GetText()