Bogdanp / Bogdanp/racket-gui-easy

is there a way to close a dialog programmatically?

Open
#24 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Racket
Stars
153
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Right now closing a rendered dialog is non-trivial, or is too ugly.
Maybe there is a way, but I can only think of either using a mixin or this which doesn't work on dialog but does on frames.
```racket
(define (d r)
(define (close-dialog) (send (renderer-root (force r)) show #f))
(dialog
(text (format "~a: first ~a characters" identity len))
(input "" (λ (evt str)
(displayln evt)
(when (eq? evt 'return)
(cond
[(string=? str (substring password 0 len))
(close-dialog)
(next-dialog)]
[else
(close-dialog)
(error-dialog)]))))))
(define r (render (d (delay r)) (get-parent)))
```
This throws an error since `r` isn't defined because of how dialog's `yield` work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.