From 748c20471e1febe4f48c46445b0b5252d06b5505 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 6 Aug 2014 20:55:38 -0700 Subject: [PATCH] Very long strings cause the GUI toolkit to complain --- support/gui.rkt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/support/gui.rkt b/support/gui.rkt index f407c47..a76321f 100644 --- a/support/gui.rkt +++ b/support/gui.rkt @@ -70,6 +70,13 @@ (if h-stretch? width min-w) (if v-stretch? height min-h)))))) +(define (string->label-string s) + ;; Per documentation for (label-string?), a label string "is a + ;; string whose length is less than or equal to 200." + (if (> (string-length s) 200) + (string-append (substring s 0 196) " ...") + s)) + (define debugger% (class object% @@ -296,7 +303,7 @@ (send events set-data n current-historical-moment) (send events set-string n dir 1) (send events set-string n type 2) - (send events set-string n (~a detail) 3) + (send events set-string n (string->label-string (~a detail)) 3) (define current-selection (send events get-selection)) (when (or (not current-selection) (= current-selection (- n 1))) (send events set-first-visible-item n)