summaryrefslogtreecommitdiff
path: root/button.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-28 01:05:06 -0400
committerPietro Gagliardi <[email protected]>2014-06-28 01:05:06 -0400
commitea6200a432c2954ec2b38afc66d1795dd161e8d9 (patch)
tree10665ae3e2ed42bb6a16027b7eb40adf7c8dee58 /button.go
parent05ffc6511ab11fa365b2e8961bc67770bbf79777 (diff)
Began the migration to the new API. Removed locks from the public control APIs; they won't be needed anymore.
Diffstat (limited to 'button.go')
-rw-r--r--button.go20
1 files changed, 0 insertions, 20 deletions
diff --git a/button.go b/button.go
index 96a68ed..2ee3efd 100644
--- a/button.go
+++ b/button.go
@@ -2,18 +2,8 @@
package ui
-import (
- "sync"
-)
-
// A Button represents a clickable button with some text.
type Button struct {
- // Clicked gets a message when the button is clicked.
- // You cannot change it once the Window containing the Button has been created.
- // If you do not respond to this signal, nothing will happen.
- Clicked chan struct{}
-
- lock sync.Mutex
created bool
sysData *sysData
initText string
@@ -30,9 +20,6 @@ func NewButton(text string) (b *Button) {
// SetText sets the button's text.
func (b *Button) SetText(text string) {
- b.lock.Lock()
- defer b.lock.Unlock()
-
if b.created {
b.sysData.setText(text)
return
@@ -42,9 +29,6 @@ func (b *Button) SetText(text string) {
// 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()
}
@@ -52,10 +36,6 @@ func (b *Button) Text() string {
}
func (b *Button) make(window *sysData) error {
- b.lock.Lock()
- defer b.lock.Unlock()
-
- b.sysData.event = b.Clicked
err := b.sysData.make(window)
if err != nil {
return err