summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'checkbox.go')
-rw-r--r--checkbox.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/checkbox.go b/checkbox.go
index cd9a896..89768ef 100644
--- a/checkbox.go
+++ b/checkbox.go
@@ -39,7 +39,17 @@ func (c *Checkbox) SetText(text string) (err error) {
return nil
}
-// TODO Checked()
+// Checked() returns whether or not the checkbox has been checked.
+func (c *Checkbox) Checked() bool {
+ c.lock.Lock()
+ defer c.lock.Unlock()
+
+ check, err := c.sysData.isChecked()
+ if err != nil {
+ panic(err) // TODO
+ }
+ return check
+}
func (c *Checkbox) apply(window *sysData) error {
c.lock.Lock()