From 02d6a03ba3a657aa7b50d072771361236bb207a3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 28 Jun 2014 16:02:50 -0400 Subject: Decided to make dialogs code-modal; will figure out how to get the behavior I want on Mac OS X - http://stackoverflow.com/questions/24468620/how-do-i-create-a-nested-run-loop-after-nsalert-beginsheetmodalforwindow-tha - Now to see if Windows works... --- dialog_windows.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'dialog_windows.go') diff --git a/dialog_windows.go b/dialog_windows.go index 5422f1c..18de661 100644 --- a/dialog_windows.go +++ b/dialog_windows.go @@ -38,20 +38,13 @@ func _msgBox(parent *Window, primarytext string, secondarytext string, uType uin if r1 == 0 { // failure panic(fmt.Sprintf("error displaying message box to user: %v\nstyle: 0x%08X\ntitle: %q\ntext:\n%s", err, uType, os.Args[0], text)) } - w.sysData.winhandler.Event(Dismissed, &dialogret{ - res: dialogResponses[r1], - }) + return dialogResponses[r1] } func (w *Window) msgBox(primarytext string, secondarytext string) { - // send to uitask so the function can return immediately - touitask(func() { - _msgBox(w, primarytext, secondarytext, _MB_OK) - }) + _msgBox(w, primarytext, secondarytext, _MB_OK) } func (w *Window) msgBoxError(primarytext string, secondarytext string) { - touitask(func() { - _msgBox(w, primarytext, secondarytext, _MB_OK|_MB_ICONERROR) - }) + _msgBox(w, primarytext, secondarytext, _MB_OK|_MB_ICONERROR) } -- cgit v1.2.3