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
|
||||
me.myTree.SendFromUser(tk.node)
|
||||
} 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
|
||||
return
|
||||
case widget.Button:
|
||||
if tk.node.IsEnabled() {
|
||||
tk.setColorButton()
|
||||
} else {
|
||||
tk.setColorButton()
|
||||
tk.setColorDisable()
|
||||
}
|
||||
return
|
||||
case widget.Checkbox:
|
||||
tk.setColorInput()
|
||||
|
|
|
@ -80,6 +80,14 @@ func (tk *guiWidget) drawView() {
|
|||
tk.v.Clear()
|
||||
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 tk.color != nil {
|
||||
tk.v.FrameColor = tk.color.frame
|
||||
|
|
Loading…
Reference in New Issue