summaryrefslogtreecommitdiff
path: root/button.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-14 20:41:36 -0500
committerPietro Gagliardi <[email protected]>2014-02-14 20:41:36 -0500
commit168b6eb112be70fb8c44f30a82a950bd20888b93 (patch)
treec3344a998b25fd7ab493339490c78f9fe4d8e84e /button.go
parent7d80fdd0f1e5ce7d0a88b29d26237c864a43e39a (diff)
Handled all controls's created field.
Diffstat (limited to 'button.go')
-rw-r--r--button.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/button.go b/button.go
index 9750037..4e3d7e1 100644
--- a/button.go
+++ b/button.go
@@ -30,7 +30,9 @@ func (b *Button) SetText(text string) (err error) {
b.lock.Lock()
defer b.lock.Unlock()
- // TODO handle created
+ if b.created {
+ return b.sysData.setText(text)
+ }
b.initText = text
return nil
}
@@ -40,8 +42,12 @@ func (b *Button) make(window *sysData) error {
defer b.lock.Unlock()
b.sysData.event = b.Clicked
- return b.sysData.make(b.initText, 300, 300, window)
- // TODO size to parent size
+ err := b.sysData.make(b.initText, 300, 300, window)
+ if err != nil {
+ return err
+ }
+ b.created = true
+ return nil
}
func (b *Button) setRect(x int, y int, width int, height int) error {