diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/cocoa/button.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/cocoa/button.rkt index 288413b5a2..1983c9d568 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/cocoa/button.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/cocoa/button.rkt @@ -53,7 +53,8 @@ (when button-type (tellv cocoa setButtonType: #:type _int button-type)) (unless button-type - (tellv cocoa setBezelStyle: #:type _int (if (not (string? label)) + (tellv cocoa setBezelStyle: #:type _int (if (or (not (string? label)) + (regexp-match? #rx"\n" label)) NSRegularSquareBezelStyle NSRoundedBezelStyle))) (cond diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/button.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/button.rkt index ba9e04b801..643340541c 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/button.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/button.rkt @@ -55,7 +55,7 @@ [(right) BS_RIGHT] [(top) BS_TOP] [(bottom) BS_BOTTOM]) - 0)) + BS_MULTILINE)) 0 0 0 0 (send parent get-content-hwnd) #f diff --git a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/window.rkt b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/window.rkt index 12949402bb..2d0079575f 100644 --- a/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/window.rkt +++ b/pkgs/gui-pkgs/gui-lib/mred/private/wx/win32/window.rkt @@ -383,7 +383,10 @@ (values (combine-w w1 w2) (combine-h h1 h2) (combine-h d1 d1) (combine-h a1 a2)))] [else - (send measure-dc get-text-extent label #f #t)]))] + (define strs (regexp-split #rx"\n" label)) + (for/fold ([w 0][h 0][d 0] [a 0]) ([str (in-list strs)]) + (define-values (tw th d a) (send measure-dc get-text-extent label #f #t)) + (values (max w tw) (+ h th) 0 0))]))] [(->int) (lambda (v) (inexact->exact (ceiling v)))]) (resize (->int (* scale-h (max (+ w dw) min-w))) (->int (* scale-w (max (+ h dh) min-h)))))))