Skip to content
14 changes: 6 additions & 8 deletions drracket-core-lib/drracket/private/palaka.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@
(define alpha (send dc get-alpha))
(send dc set-pen palaka-color 1 'transparent)
(for ([dx (in-range (- (/ quadrant-size 2)) w quadrant-size)])
(let loop ([dy (- (/ quadrant-size 2))])
(when (< dy h)
(send dc set-alpha 1)
(send dc set-brush palaka-color 'solid)
(send dc draw-rectangle dx dy quadrant-size quadrant-size)
(send dc set-brush "white" 'solid)
(draw-one-palaka dc dx dy)
(loop (+ dy quadrant-size)))))
(for ([dy (in-range (- (/ quadrant-size 2)) h quadrant-size)])
(send dc set-alpha 1)
(send dc set-brush palaka-color 'solid)
(send dc draw-rectangle dx dy quadrant-size quadrant-size)
(send dc set-brush "white" 'solid)
(draw-one-palaka dc dx dy)))
(send dc set-alpha alpha))

(define (draw-one-palaka dc dx dy)
Expand Down
17 changes: 8 additions & 9 deletions drracket-core-lib/drracket/private/syncheck-debug.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,11 @@
(make-modern info-text)
(send info-text end-edit-sequence))))

(let ()
(define f (make-object frame% "Syntax 'origin Browser" #f 600 300))
(define p (make-object horizontal-panel% f))
(make-object editor-canvas% p output-text)
(make-object editor-canvas% p info-text)
(send f show #t)))
(define f (make-object frame% "Syntax 'origin Browser" #f 600 300))
(define p (make-object horizontal-panel% f))
(make-object editor-canvas% p output-text)
(make-object editor-canvas% p info-text)
(send f show #t))

;; build-ht : stx -> hash-table
;; the resulting hash-table maps from the each sub-object's to its syntax.
Expand All @@ -136,9 +135,9 @@
(hash-set! ht res stx)
res)]
[else
(let ([res (syntax->datum stx)])
(hash-set! ht res stx)
res)]))
(define res (syntax->datum stx))
(hash-set! ht res stx)
res]))
ht))

;; make-text-port : text -> port
Expand Down
15 changes: 7 additions & 8 deletions drracket-core-lib/drracket/private/tooltip.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,13 @@
(init-field [frame-to-track #;#;: (Option (Instance Window<%>)) #f])
(: timer (Option (Instance Timer%)))
(define timer
(let ([frame-to-track frame-to-track])
(and frame-to-track
(new timer%
[notify-callback
(λ ()
(unless (send frame-to-track is-shown?)
(show #f)
(send (assert timer) stop)))]))))
(and frame-to-track
(new timer%
[notify-callback
(λ ()
(unless (send frame-to-track is-shown?)
(show #f)
(send (assert timer) stop)))])))


(define/override (on-subwindow-event r evt)
Expand Down
2 changes: 1 addition & 1 deletion drracket-core-lib/drracket/sprof.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
(map (λ (t) (continuation-mark-set->context (continuation-marks t))) (get-threads)))
(for* ([trace (in-list new-traces)]
[line (in-list trace)])
(hash-set! traces-table line (cons trace (hash-ref traces-table line '()))))
(hash-update! traces-table line (λ (v) (cons trace v)) '()))
(cond
[(zero? i)
(update-gui traces-table)
Expand Down
4 changes: 2 additions & 2 deletions drracket-core-lib/scribble/tools/drracket-buttons.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
;; if (eval 'doc) goes wrong, then we assume that's because of
;; an earlier failure, so we just don't do anything.
(when doc
(printf "scribble: loading xref\n")
(displayln "scribble: loading xref")
(define xref ((dynamic-require 'setup/xref 'load-collections-xref)))
(printf "scribble: rendering\n")
(displayln "scribble: rendering")
(parameterize ([current-input-port (open-input-string "")])
((dynamic-require 'scribble/render 'render)
(list doc)
Expand Down
21 changes: 9 additions & 12 deletions drracket-test/tests/drracket/errortrace-startup.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,15 @@ the same ones that drracket is using.
(thread
(λ ()
(let loop ([i 10])
(cond
[(zero? i)
(error 'errortrace-startup.rkt "never saw the drracket frame")]
[else
(define actives (get-top-level-windows))
(define drracket-frame-found?
(for/or ([active (in-list actives)])
(and active
(method-in-interface? 'get-execute-button (object-interface active)))))
(unless drracket-frame-found?
(sleep 1)
(loop (- i 1)))]))
(when (zero? i)
(error 'errortrace-startup.rkt "never saw the drracket frame"))
(define actives (get-top-level-windows))
(define drracket-frame-found?
(for/or ([active (in-list actives)])
(and active (method-in-interface? 'get-execute-button (object-interface active)))))
(unless drracket-frame-found?
(sleep 1)
(loop (- i 1))))
(semaphore-post sema))))

(void (yield sema))
Expand Down
10 changes: 5 additions & 5 deletions drracket-test/tests/drracket/private/gui.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@
window label class))
(let loop ([window window])
(cond
[(and (or (not class)
(is-a? window class))
(let ([win-label (and (is-a? window window<%>)
(send window get-label))])
(equal? label win-label)))
[(cond
[(or (not class) (is-a? window class))
(define win-label (and (is-a? window window<%>) (send window get-label)))
(equal? label win-label)]
[else #f])
(list window)]
[(is-a? window area-container<%>) (apply append (map loop (send window get-children)))]
[else '()])))
Expand Down
15 changes: 8 additions & 7 deletions drracket-test/tests/drracket/private/no-fw-test-util.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@
(error 'poll-until "timeout after ~e secs, ~e never returned a true value" secs pred))])
(define step 1/20)
(let loop ([counter secs])
(if (<= counter 0)
(fail)
(let ([result (pred)])
(or result
(begin
(sleep step)
(loop (- counter step))))))))
(cond
[(<= counter 0) (fail)]
[else
(define result (pred))
(or result
(begin
(sleep step)
(loop (- counter step))))])))

(define (wait-for-events-in-frame-eventspace fr)
(define sema (make-semaphore 0))
Expand Down
2 changes: 1 addition & 1 deletion drracket-test/tests/drracket/time-keystrokes.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
(loop (send w get-parent) (cons w l)))))

(when (getenv "PLTDRKEYS")
(printf "PLTDRKEYS: installing unit frame mixin\n")
(displayln "PLTDRKEYS: installing unit frame mixin")
(drracket:get/extend:extend-unit-frame tool-mixin))))

(module+ test
Expand Down
28 changes: 14 additions & 14 deletions drracket-tool-text-lib/drracket/find-module-path-completions.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,20 @@
(and (regexp? (list-ref link-ent 2))
(regexp-match (list-ref link-ent 2) (version)))
#t))
`(,(list-ref link-ent 0)
,(simplify-path
(let* ([encoded-path (list-ref link-ent 1)]
[path (cond
[(string? encoded-path) encoded-path]
[(bytes? encoded-path) (bytes->path encoded-path)]
[else (apply build-path
(for/list ([elem (in-list encoded-path)])
(if (bytes? elem)
(bytes->path-element elem)
elem)))])])
(if (relative-path? path)
(build-path base path)
path)))))]
(list (list-ref link-ent 0)
(simplify-path (let* ([encoded-path (list-ref link-ent 1)]
[path (cond
[(string? encoded-path) encoded-path]
[(bytes? encoded-path) (bytes->path encoded-path)]
[else
(apply build-path
(for/list ([elem (in-list encoded-path)])
(if (bytes? elem)
(bytes->path-element elem)
elem)))])])
(if (relative-path? path)
(build-path base path)
path)))))]
[else '()])]
[else
(for/list ([clp (in-list library-collection-paths)])
Expand Down
Loading