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 /group.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 'group.go')
| -rw-r--r-- | group.go | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -2,30 +2,41 @@ package gui import "log" -import toolkit "git.wit.org/wit/gui/toolkit/andlabs" +// import toolkit "git.wit.org/wit/gui/toolkit/andlabs" +// import newtoolkit "git.wit.org/wit/gui/toolkit" // TODO: which name is better. AddGroup or NewGroup ? // first reaction is NewGroup func (n *Node) NewGroup(name string) *Node { - var newT *toolkit.Toolkit - var gNode *Node +// var newT *toolkit.Toolkit + var newNode *Node if (GetDebug()) { log.Println("toolkit.NewGroup() START", name) } - if (n.toolkit == nil) { - log.Println("toolkit.NewGroup() toolkit == nil") - panic("toolkit should never be nil") +// if (n.toolkit == nil) { +// log.Println("toolkit.NewGroup() toolkit == nil") +// panic("toolkit should never be nil") +// } + + newNode = n.New(name) + + log.Println("gui.Node.NewGroup()", name) + for _, aplug := range allPlugins { + log.Println("gui.Node.NewGroup() toolkit plugin =", aplug.name) + if (aplug.NewGroup == nil) { + continue + } + aplug.NewGroup(&n.Widget, &newNode.Widget) } // make a *Node with a *toolkit.Group - gNode = n.New(name) - newT = n.toolkit.NewGroup(name) - gNode.toolkit = newT - gNode.Dump() + // newT = n.toolkit.NewGroup(name) + // newNode.toolkit = newT + // newNode.Dump() - return gNode + return newNode } /* |
