summaryrefslogtreecommitdiff
path: root/button.go
diff options
context:
space:
mode:
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()