diff --git a/collects/typed-scheme/optimizer/tool/display.rkt b/collects/typed-scheme/optimizer/tool/display.rkt index 4f540407f6..b61d4e0186 100644 --- a/collects/typed-scheme/optimizer/tool/display.rkt +++ b/collects/typed-scheme/optimizer/tool/display.rkt @@ -3,7 +3,7 @@ (require racket/string racket/class racket/gui/base unstable/sequence unstable/pretty) -(provide format-message make-color-table) +(provide popup-callback make-color-table) (define (format-message stxs+msgs) (string-join (for/list ([(stx msg) (in-pairs stxs+msgs)]) @@ -14,6 +14,21 @@ msg)) "\n\n")) +(define ((popup-callback stxs+msgs) ed start end) + (define text (new text%)) + (define win (new dialog% + [label "Performance Report"] + [width 500] + [height 300])) + (define editor-canvas + (new editor-canvas% [parent win] [editor text] + [style '(no-hscroll)])) + (send text auto-wrap #t) + (send text insert-port (open-input-string + (format-message stxs+msgs))) + (send text lock #t) + (send win show #t)) + (define lowest-badness-color (make-object color% "pink")) (define highest-badness-color (make-object color% "red")) ;; the higher the badness, the closer to red the highlight should be diff --git a/collects/typed-scheme/optimizer/tool/tool.rkt b/collects/typed-scheme/optimizer/tool/tool.rkt index 96fe6b9bc4..38c1c66ee0 100644 --- a/collects/typed-scheme/optimizer/tool/tool.rkt +++ b/collects/typed-scheme/optimizer/tool/tool.rkt @@ -52,21 +52,7 @@ (vector-ref color-table (missed-opt-report-entry-badness l)))]) (send this highlight-range start end color) - (send this set-clickback start end - (lambda (ed start end) - (define text (new text%)) - (define win (new dialog% - [label "Performance Report"] - [width 500] - [height 300])) - (define editor-canvas - (new editor-canvas% [parent win] [editor text] - [style '(no-hscroll)])) - (send text auto-wrap #t) - (send text insert-port (open-input-string - (format-message stxs+msgs))) - (send text lock #t) - (send win show #t))) + (send this set-clickback start end (popup-callback stxs+msgs)) ;; record highlights to undo them later (cons (list start end color) ;; missed optimizations have irritants, circle them