summaryrefslogtreecommitdiff
path: root/button.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 15:51:06 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 15:51:06 -0500
commit558c618fbf6e8a1db88ca929531d654cb49a2b60 (patch)
tree18efd030daae421308beac264c54720eb0b98f2f /button.go
parentc20e3a261195889029d71e9490674fe48104a170 (diff)
Gave all relevant controls matching SetText()/Text() pairs. Also added a TODO for Checkbox related to checked state.
Diffstat (limited to 'button.go')
-rw-r--r--button.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/button.go b/button.go
index aa1c0bd..d1b286c 100644
--- a/button.go
+++ b/button.go
@@ -37,6 +37,17 @@ func (b *Button) SetText(text string) (err error) {
return nil
}
+// Text returns the button's text.
+func (b *Button) Text() string {
+ b.lock.Lock()
+ defer b.lock.Unlock()
+
+ if b.created {
+ return b.sysData.text()
+ }
+ return b.initText
+}
+
func (b *Button) make(window *sysData) error {
b.lock.Lock()
defer b.lock.Unlock()