summaryrefslogtreecommitdiff
path: root/checkbox.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-13 15:14:10 -0500
committerPietro Gagliardi <[email protected]>2014-02-13 15:14:10 -0500
commit44842fea4b2a46ded301fb460a9a0f998fc2ee0c (patch)
tree23e7cb18336960022df2764fc6c4243d29024242 /checkbox.go
parentf3c77bda6e720fe7750fc3db2aa38f8b74faf585 (diff)
Added Checkbox.Checked().
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()