summaryrefslogtreecommitdiff
path: root/redo/zz_test.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-04 23:48:04 -0400
committerPietro Gagliardi <[email protected]>2014-08-05 00:34:24 -0400
commitb46167f1e2bb00dc1dae5b466cd78e7ae817587d (patch)
tree399c42d11325be6e6247cef5ea2baeaa6df043ce /redo/zz_test.go
parent3e25992f09d7341d827c900389e0de4a78ceca17 (diff)
Fixed up the implementation of Area on GTK+ and the Area test. Seems to be fine, though for some reason holding down a mouse button doesn't generate a drag in GTK+ 3.10...
Diffstat (limited to 'redo/zz_test.go')
-rw-r--r--redo/zz_test.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/redo/zz_test.go b/redo/zz_test.go
index 2c1a044..c54c614 100644
--- a/redo/zz_test.go
+++ b/redo/zz_test.go
@@ -10,6 +10,8 @@ import (
"reflect"
"testing"
"image"
+ "image/color"
+ "image/draw"
)
var closeOnClick = flag.Bool("close", false, "close on click")
@@ -43,10 +45,12 @@ type testwin struct {
type areaHandler struct{}
func (a *areaHandler) Paint(r image.Rectangle) *image.RGBA {
- return image.NewRGBA(r)
+ i := image.NewRGBA(r)
+ draw.Draw(i, r, &image.Uniform{color.RGBA{128,0,128,255}}, image.ZP, draw.Src)
+ return i
}
-func (a *areaHandler) Mouse(me MouseEvent) bool { return false }
-func (a *areaHandler) Key(ke KeyEvent) bool { return false }
+func (a *areaHandler) Mouse(me MouseEvent) bool { fmt.Printf("%#v\n", me); return false }
+func (a *areaHandler) Key(ke KeyEvent) bool { fmt.Printf("%#v\n", ke); return false }
func (tw *testwin) make(done chan struct{}) {
tw.t = NewTab()