parent
55735daeec
commit
50fe92a1b1
27
plugin.go
27
plugin.go
|
@ -75,12 +75,37 @@ func action(a widget.Action) {
|
|||
} else {
|
||||
// widget was already hidden
|
||||
}
|
||||
case widget.Delete:
|
||||
if w == nil {
|
||||
return
|
||||
} else {
|
||||
w.hideWidgets()
|
||||
w.deleteNode()
|
||||
}
|
||||
n.DeleteNode()
|
||||
wRoot := me.treeRoot.TK.(*guiWidget)
|
||||
wRoot.redoWindows(0, 0)
|
||||
default:
|
||||
log.Log(ERROR, "action() ActionType =", a.ActionType, "WidgetType =", a.WidgetType, "Name =", a.ProgName)
|
||||
log.Log(ERROR, "action() UNKNOWN Action Type =", a.ActionType, "WidgetType =", a.WidgetType, "Name =", a.ProgName)
|
||||
}
|
||||
log.Log(INFO, "action() END")
|
||||
}
|
||||
|
||||
func (w *guiWidget) deleteNode() {
|
||||
p := w.parent
|
||||
for i, child := range p.children {
|
||||
log.Log(NOW, "parent has child:", i, child.cuiName, child.String())
|
||||
if w == child {
|
||||
log.Log(NOW, "Found child ==", i, child.cuiName, child.String())
|
||||
log.Log(NOW, "Found n ==", i, w.cuiName, w.String())
|
||||
p.children = append(p.children[:i], p.children[i+1:]...)
|
||||
}
|
||||
}
|
||||
for i, child := range p.children {
|
||||
log.Log(NOW, "parent now has child:", i, child.cuiName, child.String())
|
||||
}
|
||||
}
|
||||
|
||||
func (w *guiWidget) AddText(text string) {
|
||||
if w == nil {
|
||||
log.Log(NOW, "widget is nil")
|
||||
|
|
Loading…
Reference in New Issue