feature request: the state of a viewport (open, hidden or closed)
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 5.2k
- Forks
- 698
- Avg merge
- 18h 34m
- Merged PRs (30d)
- 5
Description
Would it be possible to add a procedure to library graphics/graphics showing the state of a viewport (open, hidden or closed)? When closing a viewport in the title bar (upper right corner) while the program is waiting for a mouse-click or a key-press, the program keeps waiting without warning and doing nothing. When a viewport has been closed no such event can be posted. Just issuing a warning when closing a viewport would do as well. The following program not halt after the user has closed the viewport and confirmed so in the message box:
(require graphics/graphics racket/gui)
(open-graphics)
(define vp (open-viewport "close me" 100 100))
(let loop ()
(unless
(eq? (message-box "Question" "Did you close the viewport?" #f '(yes-no)) 'yes)
(loop)))
(get-mouse-click vp)
It was the first time using graphics in Racket. I have looked into "https://docs.racket-lang.org/gui/index.html". I do like the callback facilities, but find it quite complicated. I want full control over the locations of buttons. My program is at "https://github.com/joskoot/hanoi".
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the graphics/graphics library and the Racket GUI documentation, then reproduce the example with get-mouse-click and a viewport closed from its title bar. Trace how viewport closure is represented while input is pending. Done means a closed viewport can be detected or the waiting operation clearly warns or exits instead of hanging.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100