parent
55735daeec
commit
50fe92a1b1
27
plugin.go
27
plugin.go
|
@ -75,12 +75,37 @@ func action(a widget.Action) {
|
||||||
} else {
|
} else {
|
||||||
// widget was already hidden
|
// 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:
|
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")
|
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) {
|
func (w *guiWidget) AddText(text string) {
|
||||||
if w == nil {
|
if w == nil {
|
||||||
log.Log(NOW, "widget is nil")
|
log.Log(NOW, "widget is nil")
|
||||||
|
|
3
view.go
3
view.go
|
@ -169,6 +169,9 @@ func (w *guiWidget) recreateView() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *guiWidget) hideWidgets() {
|
func (w *guiWidget) hideWidgets() {
|
||||||
|
if w == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
w.isCurrent = false
|
w.isCurrent = false
|
||||||
switch w.node.WidgetType {
|
switch w.node.WidgetType {
|
||||||
case widget.Root:
|
case widget.Root:
|
||||||
|
|
Loading…
Reference in New Issue