buttons disabled on window open
This commit is contained in:
parent
36745e0492
commit
70452bdaac
|
@ -15,7 +15,8 @@ func (tk *guiWidget) doButtonClick() {
|
||||||
tk.dumpWidget("click()") // enable this to debug widget clicks
|
tk.dumpWidget("click()") // enable this to debug widget clicks
|
||||||
me.myTree.SendFromUser(tk.node)
|
me.myTree.SendFromUser(tk.node)
|
||||||
} else {
|
} else {
|
||||||
tk.dumpWidget("disabled()") // enable this to debug widget clicks
|
log.Info("button is currently disabled by the application")
|
||||||
|
// tk.dumpWidget("disabled()") // enable this to debug widget clicks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,12 @@ func addWidget(n *tree.Node) {
|
||||||
tk.color = &colorTab
|
tk.color = &colorTab
|
||||||
return
|
return
|
||||||
case widget.Button:
|
case widget.Button:
|
||||||
tk.setColorButton()
|
if tk.node.IsEnabled() {
|
||||||
|
tk.setColorButton()
|
||||||
|
} else {
|
||||||
|
tk.setColorButton()
|
||||||
|
tk.setColorDisable()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
case widget.Checkbox:
|
case widget.Checkbox:
|
||||||
tk.setColorInput()
|
tk.setColorInput()
|
||||||
|
|
|
@ -80,6 +80,14 @@ func (tk *guiWidget) drawView() {
|
||||||
tk.v.Clear()
|
tk.v.Clear()
|
||||||
fmt.Fprint(tk.v, tk.labelN)
|
fmt.Fprint(tk.v, tk.labelN)
|
||||||
|
|
||||||
|
// tmp hack to disable buttons on window open
|
||||||
|
if tk.node.WidgetType == widget.Button {
|
||||||
|
if tk.node.IsEnabled() {
|
||||||
|
} else {
|
||||||
|
tk.setColorDisable()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if you don't do this here, it will be black & white only
|
// if you don't do this here, it will be black & white only
|
||||||
if tk.color != nil {
|
if tk.color != nil {
|
||||||
tk.v.FrameColor = tk.color.frame
|
tk.v.FrameColor = tk.color.frame
|
||||||
|
|
Loading…
Reference in New Issue