summaryrefslogtreecommitdiff
path: root/dialog_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-10 12:34:30 -0400
committerPietro Gagliardi <[email protected]>2014-04-10 12:35:37 -0400
commit013e8707dac20dee4c72840989b69757bf26e72b (patch)
tree48da8ee617708a48e031d8cf2a7a21cdfb0205a8 /dialog_darwin.go
parent9e185d815eec14ea9f50ffbbbf171cf78e597808 (diff)
Removed unnecessary space if the secondaryText argument to MsgBox***() is an empty string. This doesn't change much on Mac OS X; it always shows the informational text field, showing an empty string by default. On GTK+ it seems to get rid of the bold over the primary text; I'm going to assume this is intentional (it looks that way on GTK+ 2; the HIG docs have outdated screenshots...).
Diffstat (limited to 'dialog_darwin.go')
-rw-r--r--dialog_darwin.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/dialog_darwin.go b/dialog_darwin.go
index 89c3211..6de751a 100644
--- a/dialog_darwin.go
+++ b/dialog_darwin.go
@@ -33,7 +33,9 @@ func _msgBox(primarytext string, secondarytext string, style uintptr, button0 st
uitask <- func() {
box := C.objc_msgSend_noargs(_NSAlert, _new)
C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext))
- C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext))
+ if secondarytext != "" {
+ C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext))
+ }
C.objc_msgSend_uint(box, _setAlertStyle, C.uintptr_t(style))
C.objc_msgSend_id(box, _addButtonWithTitle, toNSString(button0))
C.objc_msgSend_noargs(box, _runModal)