Very long strings cause the GUI toolkit to complain

This commit is contained in:
Tony Garnock-Jones 2014-08-06 20:55:38 -07:00
parent 205dac32db
commit 748c20471e
1 changed files with 8 additions and 1 deletions

View File

@ -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)