From 8a81650b3da7ce00725336df9e03b38e935c5a65 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 2 Jul 2014 22:53:03 -0400 Subject: Moved it all back; the preemptive multitaksing during an event handler kills us on all platforms. Going to have to restrict ALL GUI accss to happening from one t hread, so going to need to drop uitask entirely and have just a start() callback for startup code and a post() function for posting requests to windows (like channel sends but into a perpetual buffer). --- prevlib/dialog.go | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 prevlib/dialog.go (limited to 'prevlib/dialog.go') diff --git a/prevlib/dialog.go b/prevlib/dialog.go deleted file mode 100644 index 6c62bfd..0000000 --- a/prevlib/dialog.go +++ /dev/null @@ -1,52 +0,0 @@ -// 7 february 2014 - -package ui - -// Response denotes a response from the user to a Dialog. -type Response uint -const ( - NotDone Response = iota - OK -) - -// sentinel (not nil so programmer errors don't go undetected) -// this window is invalid and cannot be used directly -// notice the support it uses -var dialogWindow = new(Window) - -// MsgBox displays an informational message box to the user with just an OK button. -// primaryText should be a short string describing the message, and will be displayed with additional emphasis on platforms that support it. -// Optionally, secondaryText can be used to show additional information. -// If you pass an empty string for secondaryText, neither additional information nor space for additional information will be shown. -// On platforms that allow for the message box window to have a title, os.Args[0] is used. -// -// See "On Dialogs" in the package overview for behavioral information. -func MsgBox(primaryText string, secondaryText string) { - dialogWindow.msgBox(primaryText, secondaryText) -} - -// MsgBox is the Window method version of the package-scope function MsgBox. -// See that function's documentation and "On Dialogs" in the package overview for more information. -func (w *Window) MsgBox(primaryText string, secondaryText string) { - if !w.created { - panic("parent window passed to Window.MsgBox() before it was created") - } - w.msgBox(primaryText, secondaryText) -} - -// MsgBoxError displays a message box to the user with just an OK button and an icon indicating an error. -// Otherwise, it behaves like MsgBox. -// -// See "On Dialogs" in the package overview for more information. -func MsgBoxError(primaryText string, secondaryText string) { - dialogWindow.msgBoxError(primaryText, secondaryText) -} - -// MsgBoxError is the Window method version of the package-scope function MsgBoxError. -// See that function's documentation and "On Dialogs" in the package overview for more information. -func (w *Window) MsgBoxError(primaryText string, secondaryText string) { - if !w.created { - panic("parent window passed to Window.MsgBox() before it was created") - } - w.msgBoxError(primaryText, secondaryText) -} -- cgit v1.2.3