diff options
| author | Jeff Carr <[email protected]> | 2022-11-13 08:53:03 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2022-11-13 08:53:03 -0600 |
| commit | 207cf7ea16f1da8fa9f893504d77a2856298cc22 (patch) | |
| tree | 54d513b83ce797be75268f7d8867e0b01ab8f23e /toolkit/gocui/greeter.go | |
| parent | ed382bec55be25039e4dcf020d1512139855c9bb (diff) | |
Massive refactor to use go plugins. This is neat.
update README.md
set xterm title. make os.Exit() default on window close
add a toolkit.Widget to the node structure
remove 'Greeter' symbol mapping scheme
removed the testing greeter code
plugins:
attempt to load plugins in a sensible order
andlabs/ui:
working andlabs/ui plugin (andlabs2)
buttons work in andlabs plugin
TODO: re-implement non-plugin version for Windows
mswindows doesn't support go plugins yet
gocui:
put the gocui console so file in the binary
does a full init of gocui plugin
Button() and Group() working very well with gogui
cleanly exit gocui
technically you can load two toolkits at the same time
kinda both working at the same time. esoteric
two working plugins at the same time
give up working on two gui's at the same time
this is fun, but _not interesting
wow. this actually works. NewButton() from both toolkits
examples:
all the examples run again
remove early helloplugin example
buttonplugin example cmd code
buttonplugin runs and ldd is minimum
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/greeter.go')
| -rw-r--r-- | toolkit/gocui/greeter.go | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/toolkit/gocui/greeter.go b/toolkit/gocui/greeter.go deleted file mode 100644 index e3094e5..0000000 --- a/toolkit/gocui/greeter.go +++ /dev/null @@ -1,79 +0,0 @@ -package main - -import ( - "log" - - // "errors" - // "fmt" - // "strings" - // "github.com/awesome-gocui/gocui" -) - -type greeting string - -// stores the raw toolkit internals -type toolkit struct { - id string - Name string - - OnChanged func(toolkit) -} - -// this is exported -var Greeter greeting -var Toolkit toolkit - -// func main() { -func (g greeting) Greet() { - log.Println("Hello Universe") - Init() - // ToolkitMain() -} - -func (g greeting) JcarrButton() { - log.Println("Hello GreetButton meet Universe") - addButton("Greet foo") - addButton("Greet foo 2") -} - -func addGroup(name string) { - log.Println("addGroup()", name) - currentY = 2 - currentX += groupSize + 6 -} - -func (g greeting) AddButton(name string) { -// func (g greeting) AddButton() { - log.Println("gui.gocui.AddButton()", name) - addButton(name) -} - -/* -func addButton(name string) error { - t := len(name) - v, err := baseGui.SetView(name, currentX, currentY, currentX+t+3, currentY+2, 0) - if err == nil { - return err - } - if !errors.Is(err, gocui.ErrUnknownView) { - return err - } - - v.Wrap = true - fmt.Fprintln(v, " " + name) - fmt.Fprintln(v, strings.Repeat("foo\n", 2)) - - if _, err := baseGui.SetCurrentView(name); err != nil { - return err - } - - views = append(views, name) - curView = len(views) - 1 - idxView += 1 - currentY += 3 - if (groupSize < len(views)) { - groupSize = len(views) - } - return nil -} -*/ |
