summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--area.go6
-rw-r--r--label.go16
-rw-r--r--test/main.go4
4 files changed, 8 insertions, 20 deletions
diff --git a/README.md b/README.md
index ab20549..742ca82 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
[![Build Status](https://travis-ci.org/andlabs/ui.png?branch=master)](https://travis-ci.org/andlabs/ui)
# Native UI library for Go
+### CRITICAL UPDATE 17 March 2014: Due to deadlocks between resizing and setting label text once a second, Labels and Areas do not lock their internal mutex locks after their Window has been created. This seems to not have issues, and the Go race detector isn't saying anything, so IDK... Please help with this if you can. I will have to remove the mutexes from the other classes (later) to make this work properly.
+
### THIS PACKAGE IS UNDER ACTIVE DEVELOPMENT. It can be used; the API is stable enough at this point, but keep in mind there may still be crashes and API changes, as suggestions are always open. If you can help, please do! Run `./test` to build a test binary `test/test` which runs a (mostly) feature-complete UI test. Run `./d32 ./test` to build a 32-bit version (you will need a cgo-enabled 32-bit go environment, and I have only tested this on Mac OS X).
### UPDATE 12 March 2014: Windows 2000 is no longer supported [as it is no longer supported by Go](https://codereview.appspot.com/74790043).
diff --git a/area.go b/area.go
index 983c547..93f319e 100644
--- a/area.go
+++ b/area.go
@@ -122,15 +122,9 @@ func (a *Area) make(window *sysData) error {
}
func (a *Area) setRect(x int, y int, width int, height int, winheight int) error {
- a.lock.Lock()
- defer a.lock.Unlock()
-
return a.sysData.setRect(x, y, width, height, winheight)
}
func (a *Area) preferredSize() (width int, height int) {
- a.lock.Lock()
- defer a.lock.Unlock()
-
return a.sysData.preferredSize()
}
diff --git a/label.go b/label.go
index 76344f9..82b8731 100644
--- a/label.go
+++ b/label.go
@@ -24,24 +24,22 @@ func NewLabel(text string) *Label {
// SetText sets the Label's text.
func (l *Label) SetText(text string) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
l.sysData.setText(text)
return
}
+ l.lock.Lock()
+ defer l.lock.Unlock()
l.initText = text
}
// Text returns the Label's text.
func (l *Label) Text() string {
- l.lock.Lock()
- defer l.lock.Unlock()
-
if l.created {
return l.sysData.text()
}
+ l.lock.Lock()
+ defer l.lock.Unlock()
return l.initText
}
@@ -58,15 +56,9 @@ func (l *Label) make(window *sysData) error {
}
func (l *Label) setRect(x int, y int, width int, height int, winheight int) error {
- l.lock.Lock()
- defer l.lock.Unlock()
-
return l.sysData.setRect(x, y, width, height, winheight)
}
func (l *Label) preferredSize() (width int, height int) {
- l.lock.Lock()
- defer l.lock.Unlock()
-
return l.sysData.preferredSize()
}
diff --git a/test/main.go b/test/main.go
index e032aca..6023991 100644
--- a/test/main.go
+++ b/test/main.go
@@ -120,7 +120,7 @@ type areaHandler struct {
img *image.NRGBA
}
func (a *areaHandler) Paint(rect image.Rectangle) *image.NRGBA {
-fmt.Println(rect)
+//fmt.Println(rect)
/*
req.Out <- img[i].SubImage(req.Rect).(*image.NRGBA)
if lastrect != req.Rect {
@@ -131,7 +131,7 @@ fmt.Println(rect)
return a.img.SubImage(rect).(*image.NRGBA)
}
func (a *areaHandler) Mouse(e MouseEvent) {
- fmt.Printf("%#v\n", e)
+// fmt.Printf("%#v\n", e)
}
var doArea = flag.Bool("area", false, "run area test instead")