summaryrefslogtreecommitdiff
path: root/redo/zz_test.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-26 12:52:32 -0400
committerPietro Gagliardi <[email protected]>2014-08-26 12:52:32 -0400
commitadbe5303e7d97e439e1f1f75df23d357b037f702 (patch)
treea9bafa99c1def93cae7afc54c3f2679445b3c0f5 /redo/zz_test.go
parente7490ce49b113f4d1877de8f5ee4b40b183fbabf (diff)
Changed the way dialogs work so that they do real modality properly and implemented such on Windows.
Diffstat (limited to 'redo/zz_test.go')
-rw-r--r--redo/zz_test.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/redo/zz_test.go b/redo/zz_test.go
index ab6591e..0afd7d7 100644
--- a/redo/zz_test.go
+++ b/redo/zz_test.go
@@ -75,6 +75,13 @@ func (a *areaHandler) Paint(r image.Rectangle) *image.RGBA {
func (a *areaHandler) Mouse(me MouseEvent) { fmt.Printf("%#v\n", me) }
func (a *areaHandler) Key(ke KeyEvent) bool { fmt.Printf("%#v %q\n", ke, ke.Key); return a.handled }
+func (tw *testwin) openFile(fn string) {
+ if fn == "" {
+ fn = "<no file selected>"
+ }
+ tw.fnlabel.SetText(fn)
+}
+
func (tw *testwin) addfe() {
tw.festart = NewButton("Start")
tw.festart.OnClicked(func() {
@@ -106,11 +113,7 @@ func (tw *testwin) addfe() {
})
tw.openbtn = NewButton("Open")
tw.openbtn.OnClicked(func() {
- fn := OpenFile()
- if fn == "" {
- fn = "<no file selected>"
- }
- tw.fnlabel.SetText(fn)
+ OpenFile(tw.w, tw.openFile)
})
tw.fnlabel = NewStandaloneLabel("<no file selected>")
tw.festack = NewVerticalStack(tw.festart, tw.felabel, tw.festop,