stubbed in tables

This commit is contained in:
Jeff Carr 2025-02-13 20:11:53 -06:00
parent 514b39e382
commit a16207bd1e
4 changed files with 7 additions and 42 deletions

View File

@ -1,7 +1,6 @@
package main
import (
"go.wit.com/dev/andlabs/ui"
"go.wit.com/log"
"go.wit.com/toolkits/tree"
"go.wit.com/widget"
@ -81,7 +80,6 @@ func ready(n *tree.Node) bool {
func hide(n *tree.Node) {
show(n, false)
n.State.Hidden = true
}
func show(n *tree.Node, b bool) {
@ -203,41 +201,3 @@ func AddText(n *tree.Node, s string) {
// w.AddText(s)
addText(n, s)
}
func newAction(n *tree.Node, atype widget.ActionType) {
log.Log(INFO, "newaction() START", atype)
if n == nil {
log.Log(WARN, "Tree Error: Add() sent n == nil")
return
}
if n.TK == nil {
log.Log(WARN, "Tree sent an action on a widget we didn't seem to have.")
// do this init here again? Probably something
// went wrong and we should reset the our while gocui.View tree
n.TK = initWidget(n)
}
// w := n.TK.(*guiWidget)
switch atype {
case widget.Show:
log.Log(ANDLABS, "Show() HERE. a.Hidden() was =", n.Hidden())
show(n, true)
case widget.Hide:
log.Log(ANDLABS, "Hide() HERE. a.State.Hidden was =", n.Hidden())
hide(n)
case widget.Move:
log.Log(ANDLABS, "attempt to move() =", atype, n.WidgetType, n.ProgName())
case widget.ToolkitClose:
log.Log(NOW, "attempting to Quit andlabs.ui")
// standardClose()
ui.Quit()
case widget.Enable:
enable(n, true)
case widget.Disable:
enable(n, false)
case widget.Delete:
widgetDelete(n)
default:
log.Log(ERROR, "newaction() UNHANDLED Action Type =", atype, "WidgetType =", n.WidgetType, "Name =", n.ProgName())
}
log.Log(INFO, "newaction() END", atype, n.String())
}

View File

@ -7,7 +7,6 @@ import (
"go.wit.com/log"
"go.wit.com/toolkits/tree"
"go.wit.com/widget"
"go.wit.com/dev/andlabs/ui"
// the _ means we only need this for the init()
@ -24,11 +23,13 @@ var uiMainUndef bool = true
var uiMain sync.Once
var muAction sync.Mutex
/*
func newaction(n *tree.Node, atype widget.ActionType) {
ui.QueueMain(func() {
newAction(n, atype)
})
}
*/
func queueAdd(n *tree.Node) {
ui.QueueMain(func() {

View File

@ -38,6 +38,10 @@ import (
func place(p *tree.Node, n *tree.Node) bool {
log.Log(INFO, "place() 1 START", n.WidgetType, n.GetProgName(), n.GetLabel())
if p == nil {
log.Log(WARN, "place() parent == nil")
return false
}
if !ready(n) {
if n.WidgetType == widget.Window {
// TODO: figure out window in window placement

View File

@ -55,7 +55,6 @@ func PluginChannel() chan widget.Action {
func initTree() *tree.TreeInfo {
t := tree.New()
t.PluginName = PLUGIN
t.NodeAction = newaction
t.Add = newAdd
t.SetTitle = setTitle
t.SetLabel = setLabel
@ -64,6 +63,7 @@ func initTree() *tree.TreeInfo {
t.SetChecked = setChecked
t.ToolkitClose = toolkitClose
t.ShowTable = showTable
t.Show = showTable
return t
}