diff options
Diffstat (limited to 'toolkit/gocui/plugin.go')
| -rw-r--r-- | toolkit/gocui/plugin.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/toolkit/gocui/plugin.go b/toolkit/gocui/plugin.go index eb3f2af..1758690 100644 --- a/toolkit/gocui/plugin.go +++ b/toolkit/gocui/plugin.go @@ -15,8 +15,15 @@ func Action(a *toolkit.Action) { w := findWidget(a.WidgetId, me.rootNode) switch a.ActionType { case toolkit.Add: - w = makeWidget(a) - w.addWidget() + if (w == nil) { + w = makeWidget(a) + w.addWidget() + } else { + // this is done to protect the plugin being 'refreshed' with the + // widget binary tree. TODO: find a way to keep them in sync + log(logError, "Action() Add ignored for already defined widget", + a.WidgetId, a.ActionType, a.WidgetType, a.Name) + } case toolkit.Show: if (a.B) { w.drawView() |
