diff options
| author | Jeff Carr <[email protected]> | 2023-03-29 23:03:04 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-29 23:03:04 -0500 |
| commit | 4e28cde838683188bfbd9222746409538828592d (patch) | |
| tree | 3c84fffc14352329bc41e6b58910ff278c99f08c /cmds | |
| parent | d4787a1ebdd08359746516dbb72f1feaf95be5b6 (diff) | |
add semi-working gocuiv0.7.4
commit 947169df5a22c9f9b53f825764747f648c70ff1e
Author: Jeff Carr <[email protected]>
Date: Wed Mar 29 22:44:08 2023 -0500
ready for version v0.7.4
start deprecating toolkit.Widget
switch to variable name 'ParentId'
use 'ActionType' and 'WidgetType'
preliminary redraw()
final definition of variables 'Name' and 'Text'
more cleaning of the code
remove lots of dumb code
bind 'd' key press to dump out debugging info
early color handling in gocui!
Signed-off-by: Jeff Carr <[email protected]>
commit 6013fde8332e8ecbffaf1a0977ba2e1da8ea8775
Author: Jeff Carr <[email protected]>
Date: Sun Mar 26 17:19:20 2023 -0500
improvements towards a working dns control panel
democui has the help menu
try to add mouse support to gocui
make a direct access method
Margin() and Pad() tests
add SPEW
also push devel branch to github
Signed-off-by: Jeff Carr <[email protected]>
commit 6f91f5e080e06cdc0f34b13d23e5fd16ea37259a
Author: Jeff Carr <[email protected]>
Date: Fri Mar 24 20:14:18 2023 -0500
starting to try safe chan and goroutines
fix tab title's
right before attempting to add chan goroutines
removed "where" widget pointer
box added to tab
experiement with log as it's own repo
Signed-off-by: Jeff Carr <[email protected]>
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/buttonplugin/Makefile | 6 | ||||
| -rw-r--r-- | cmds/buttonplugin/main.go | 58 | ||||
| -rw-r--r-- | cmds/textbox/Makefile | 3 | ||||
| -rw-r--r-- | cmds/textbox/main.go | 12 |
4 files changed, 43 insertions, 36 deletions
diff --git a/cmds/buttonplugin/Makefile b/cmds/buttonplugin/Makefile index 49d190c..12c23a8 100644 --- a/cmds/buttonplugin/Makefile +++ b/cmds/buttonplugin/Makefile @@ -8,7 +8,7 @@ run: build # ./buttonplugin >/tmp/buttonplugin.log 2>&1 - ./buttonplugin + ./buttonplugin >/tmp/witgui.log.stderr 2>&1 build-release: go get -v -u -x . @@ -21,3 +21,7 @@ build: update: GO111MODULE="off" go get -v -u -x . + +log: + reset + tail -f /tmp/witgui.* /tmp/guilogfile diff --git a/cmds/buttonplugin/main.go b/cmds/buttonplugin/main.go index 8a76a8b..b7f97d5 100644 --- a/cmds/buttonplugin/main.go +++ b/cmds/buttonplugin/main.go @@ -12,11 +12,7 @@ import ( var title string = "Demo Plugin Window" var outfile string = "/tmp/guilogfile" -// this is broken. delete this - func main() { - // this set the xterm and mate-terminal window title. maybe works generally? - fmt.Println("\033]0;" + title + "\007") // time.Sleep(5 * time.Second) // var w *gui.Node @@ -54,27 +50,49 @@ var counter int = 5 // This creates a window func buttonWindow() { - var w, g *gui.Node + var w, t, g, more, more2 *gui.Node gui.Config.Title = title gui.Config.Width = 640 gui.Config.Height = 480 w = gui.NewWindow() - g = w.NewGroup("buttonGroup") + t = w.NewTab("buttonTab") + g = t.NewGroup("buttonGroup") - g.NewButton("this app is old", func () { + g.NewButton("this app is useful for plugin debuggin", func () { }) g.NewLabel("STDOUT is set to: " + outfile) g.NewButton("hello", func () { log.Println("world") }) + more = g.NewGroup("more") + + g.NewButton("Load 'democui'", func () { + // this set the xterm and mate-terminal window title. maybe works generally? + fmt.Println("\033]0;" + title + "blah \007") + gui.StartS("democui") + }) + + g.NewButton("Redraw 'democui'", func () { + fmt.Println("\033]0;" + title + "blah2 \007") + gui.Redraw("democui") + }) + + g.NewButton("NewButton(more)", func () { + log.Println("new foobar 2. Adding button 'foobar 3'") + name := "foobar " + strconv.Itoa(counter) + counter += 1 + more.NewButton(name, func () { + log.Println("Got all the way to main() name =", name) + }) + }) - g.NewButton("NewButton()", func () { + g.NewButton("NewButton(more2)", func () { log.Println("new foobar 2. Adding button 'foobar 3'") name := "foobar " + strconv.Itoa(counter) counter += 1 - g.NewButton(name, func () { + more2.NewButton(name, func () { log.Println("Got all the way to main() name =", name) }) }) @@ -83,30 +101,12 @@ func buttonWindow() { log.Println("new foobar 2. Adding button 'foobar 3'") name := "neat " + strconv.Itoa(counter) counter += 1 - g.NewGroup(name) + more.NewGroup(name) }) g.NewButton("gui.DebugWindow()", func () { gui.DebugWindow() }) - g.NewButton("LoadToolkit(andlabs)", func () { - gui.LoadToolkit("andlabs") - }) - - g.NewButton("LoadToolkit(gocui)", func () { - gui.LoadToolkit("gocui") - }) - - g.NewButton("Init()", func () { - log.Println("gui.Init() is deprecated(?)") - //gui.Init() - }) - - g.NewButton("Main()", func () { - go gui.Main(func () { - w := gui.NewWindow() - w.NewGroup("buttonGroup") - }) - }) + more2 = g.NewGroup("more2") } diff --git a/cmds/textbox/Makefile b/cmds/textbox/Makefile index 6ca4329..5785c10 100644 --- a/cmds/textbox/Makefile +++ b/cmds/textbox/Makefile @@ -1,5 +1,6 @@ run: build - GOTRACEBACK=all ./textbox --gui-debug + # GOTRACEBACK=all ./textbox --gui-debug + GOTRACEBACK=all ./textbox --gui-debug >/tmp/witgui.log.stderr 2>&1 build-release: go get -v -u -x . diff --git a/cmds/textbox/main.go b/cmds/textbox/main.go index 33d0cae..0dd17e6 100644 --- a/cmds/textbox/main.go +++ b/cmds/textbox/main.go @@ -24,7 +24,9 @@ func main() { arg.MustParse(&args) log.Println("Toolkit = ", args.Toolkit) - // gui.InitPlugins([]string{"andlabs"}) + // gui.SetDebug(true) + // gui.InitPlugins([]string{"gocui"}) + // gui.InitPlugins([]string{"democui"}) gui.Main(initGUI) } @@ -68,10 +70,10 @@ func addDemoTab(window *gui.Node, title string) { dd.AddDropdownName("more 2") dd.AddDropdownName("more 3") - g.SetNext(3,1) - g1.NewLabel("label (3,1)") - g.SetNext(3,2) - g1.NewLabel("label (3,2)") + // 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") |
