summaryrefslogtreecommitdiff
path: root/colorNew.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-09 06:45:01 -0600
committerJeff Carr <[email protected]>2025-02-09 06:45:01 -0600
commit4a009f79a23b9ce1ac9198fee2fb36a12c13ac60 (patch)
treef2d62c251f55a0c18364ac6b26ffb55d53e4c964 /colorNew.go
parent70452bdaac9a558c6266f1f46121222c38e17487 (diff)
fix panic in Enable() and Disable()
Diffstat (limited to 'colorNew.go')
-rw-r--r--colorNew.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/colorNew.go b/colorNew.go
index f537c5c..76dcab6 100644
--- a/colorNew.go
+++ b/colorNew.go
@@ -27,6 +27,9 @@ func (tk *guiWidget) restoreEnableColor() {
// DONE ON DISABLE() WIDGET
// makes the button look disabled
func (tk *guiWidget) setColorDisable() {
+ if tk.color == nil {
+ tk.color = new(colorT)
+ }
// save the current color
tk.color.frame = superLightGrey
tk.color.fg = gocui.ColorBlack