Skip to content

Commit

Permalink
instead of using the is-shown? method to determine if the button is…
Browse files Browse the repository at this point in the history
… present, use membership in the parent's list of children

this more directly corresponds to what `add-child` and `delete-child` do
  • Loading branch information
rfindler committed Sep 12, 2024
1 parent f747ddd commit 0578440
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drracket/gui-debugger/debug-tool.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1567,11 +1567,15 @@
(not (is-a? lang drscheme:module-language:module-language<%>)) ;; the opt-out button handles this language
(not (debugger-does-not-work-for?
(extract-language-level settings))))])
(define debug-parent (send debug-button get-parent))
(define debug-button-currently-visible? (member debug-button (send debug-parent get-children)))
(if visible?
(unless (send debug-button is-shown?)
(send (send debug-button get-parent) add-child debug-button))
(when (send debug-button is-shown?)
(send (send debug-button get-parent) delete-child debug-button)))))
(unless debug-button-currently-visible?
(printf "changing to add button\n")
(send debug-parent add-child debug-button))
(when debug-button-currently-visible?
(printf "changing to remove button\n")
(send debug-parent delete-child debug-button)))))

(send (get-button-panel) change-children
(lambda (children)
Expand Down

0 comments on commit 0578440

Please sign in to comment.