diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-27 20:31:23 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-27 20:31:23 -0400 |
| commit | ab6e7121e47e7339822aa3e0180285b2a1c38c7c (patch) | |
| tree | f3be96564689b259d72b12d6f279369d3995c478 /test/main.go | |
| parent | 9dc4f8694c39304140df92a5466be862ed22f912 (diff) | |
Added a flag to AreaHandler.Key()/Mouse() to indicate that a repaint is needed after that event has been handled. (Having Repaint() as a method deadlocked for the same reason resizing deadlocked before.)
Diffstat (limited to 'test/main.go')
| -rw-r--r-- | test/main.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/main.go b/test/main.go index 60108ab..1e2b465 100644 --- a/test/main.go +++ b/test/main.go @@ -131,12 +131,13 @@ func (a *areaHandler) Paint(rect image.Rectangle) *image.NRGBA { */ return a.img.SubImage(rect).(*image.NRGBA) } -func (a *areaHandler) Mouse(e MouseEvent) { +func (a *areaHandler) Mouse(e MouseEvent) bool { fmt.Printf("%#v\n", e) + return false } -func (a *areaHandler) Key(e KeyEvent) bool { +func (a *areaHandler) Key(e KeyEvent) (bool, bool) { fmt.Printf("%#v\n", e) - return false + return false, false } var doArea = flag.Bool("area", false, "run area test instead (overrides -kb)") |
