1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

added Disable method

This commit is contained in:
Hossein Mehrabi 2018-06-08 05:28:45 +04:30
parent 295e2f2099
commit 9b7f31877d
2 changed files with 5 additions and 0 deletions

View File

@ -3,4 +3,5 @@ package wtf
type Enabler interface { type Enabler interface {
Disabled() bool Disabled() bool
Enabled() bool Enabled() bool
Disable()
} }

View File

@ -61,6 +61,10 @@ func (widget *TextWidget) Enabled() bool {
return widget.enabled return widget.enabled
} }
func (widget *TextWidget) Disable() {
widget.enabled = false
}
func (widget *TextWidget) Focusable() bool { func (widget *TextWidget) Focusable() bool {
return widget.enabled && widget.focusable return widget.enabled && widget.focusable
} }