From 6c78cd266a72cfe9e4b4b0db82d713c7c4728d35 Mon Sep 17 00:00:00 2001 From: Leif Andersen Date: Mon, 24 Oct 2016 11:39:18 -0400 Subject: [PATCH] Fixes bug in slider% It would occasionally drop the last digit in the message field. This turned out to be a bug where the number, while smaller, was wider. For example: 11111 10101 In variable width fonts the second one will be wider --- gui-lib/mred/private/wx/cocoa/slider.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui-lib/mred/private/wx/cocoa/slider.rkt b/gui-lib/mred/private/wx/cocoa/slider.rkt index ac07d28b..9080dfaf 100644 --- a/gui-lib/mred/private/wx/cocoa/slider.rkt +++ b/gui-lib/mred/private/wx/cocoa/slider.rkt @@ -164,7 +164,8 @@ (flip (inexact->exact (floor (tell #:type _double slider-cocoa doubleValue))))) (define/public (update-message [val (get-value)]) - (tellv message-cocoa setStringValue: #:type _NSString (format "~a" val))) + (tellv message-cocoa setStringValue: #:type _NSString (format "~a" val)) + (tellv message-cocoa sizeToFit)) (inherit get-cocoa-window) (define/override (post-mouse-down)