diff options
| author | Jeff Carr <[email protected]> | 2023-12-20 05:58:33 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-20 05:58:33 -0600 |
| commit | 85b9a036c289fe840e69e1852866f429b87cf63e (patch) | |
| tree | eb18f693027cd220f71c0fb015a67346d82a37cc /toolkit/gocui/plugin.go | |
| parent | 87ab9a958d9eb9f4db35d5c9f9ce923df3132dad (diff) | |
code moved to the cloudflare package
use the cloudflare package
add a protobuf attempt
better change detection, but formatting is broken
don't redraw widgets if they are not visible
create new dns entry worked
attempting a DNS RR create
attempt a create API call
use cloudflare recommended ENV vars
turn off debugging
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/gocui/plugin.go')
| -rw-r--r-- | toolkit/gocui/plugin.go | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/toolkit/gocui/plugin.go b/toolkit/gocui/plugin.go index eae811d..18cb71f 100644 --- a/toolkit/gocui/plugin.go +++ b/toolkit/gocui/plugin.go @@ -51,8 +51,22 @@ func action(a *toolkit.Action) { case toolkit.CloseToolkit: log(logNow, "attempting to close the plugin and release stdout and stderr") standardExit() + case toolkit.Enable: + if n.Visible() { + // widget was already shown + } else { + log(logInfo, "Setting Visable to true", a.Name) + n.SetVisible(true) + } + case toolkit.Disable: + if n.Visible() { + log(logInfo, "Setting Visable to false", a.Name) + n.SetVisible(false) + } else { + // widget was already hidden + } default: - log(logError, "action() Unknown =", a.ActionType, a.WidgetType, a.Name) + log(logError, "action() ActionType =", a.ActionType, "WidgetType =", a.WidgetType, "Name =", a.Name) } log(logInfo, "action() END") } @@ -70,16 +84,28 @@ func (n *node) AddText(text string) { } func (n *node) SetText(text string) { + var changed bool = false if (n == nil) { log(logNow, "widget is nil") return } - n.S = text - n.Text = text + if (n.Text != text) { + n.Text = text + changed = true + } + if (n.S != text) { + n.S = text + changed = true + } + if (! changed) { + return + } - n.textResize() - n.deleteView() - n.showView() + if (n.Visible()) { + n.textResize() + n.deleteView() + n.showView() + } } func (n *node) Set(val any) { |
