diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-12 12:14:24 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-12 12:14:24 -0400 |
| commit | 2fb7056be4e26a5eecc365cd2608a8e8d552807f (patch) | |
| tree | f7be4deffa81b6a028796790500e90f66aa2932f /dialog_darwin.go | |
| parent | 6eea59c30a9fb2d87f5806e6ddc12822228ac169 (diff) | |
Standardized message boxes so they appear similarly on all platforms. This shafts Windows because primary/secondary text message boxes were only added in Windows Vista, but at least MSDN provides discourse.
Diffstat (limited to 'dialog_darwin.go')
| -rw-r--r-- | dialog_darwin.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/dialog_darwin.go b/dialog_darwin.go index ff7e166..7021a30 100644 --- a/dialog_darwin.go +++ b/dialog_darwin.go @@ -26,14 +26,13 @@ var ( _runModal = sel_getUid("runModal") ) -func _msgBox(title string, text string, style uintptr, button0 string) { +func _msgBox(primarytext string, secondarytext string, style uintptr, button0 string) { ret := make(chan struct{}) defer close(ret) uitask <- func() { box := objc_new(_NSAlert) - // TODO is this appropriate for title? - C.objc_msgSend_id(box, _setMessageText, toNSString(title)) - C.objc_msgSend_id(box, _setInformativeText, toNSString(text)) + C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext)) + C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext)) objc_msgSend_uint(box, _setAlertStyle, style) C.objc_msgSend_id(box, _addButtonWithTitle, toNSString(button0)) C.objc_msgSend_noargs(box, _runModal) @@ -42,11 +41,11 @@ func _msgBox(title string, text string, style uintptr, button0 string) { <-ret } -func msgBox(title string, text string) { +func msgBox(primarytext string, secondarytext string) { // TODO _NSInformationalAlertStyle? - _msgBox(title, text, _NSWarningAlertStyle, "OK") + _msgBox(primarytext, secondarytext, _NSWarningAlertStyle, "OK") } -func msgBoxError(title string, text string) { - _msgBox(title, text, _NSCriticalAlertStyle, "OK") +func msgBoxError(primarytext string, secondarytext string) { + _msgBox(primarytext, secondarytext, _NSCriticalAlertStyle, "OK") } |
