- Using racket gui library, I find I can’t a real modal dialog that when it’s showed, it’s impossible to activate its parent window.
- Although the dialog will block its parent’s eventspace, the menu bar in parent window can be clicked, and thus the same dialog can be showed again and again. Following is the code:
#lang racket/gui
(define frame (new frame%
[label "test"]
[width 200]
[height 200]))
(define mb (new menu-bar% [parent frame]))
(let ([m (new menu%
[parent mb]
[label "&About"])])
(new menu-item%
[parent m]
[label "&About"]
[callback (lambda (b e) (message-box "About" "This is a test." frame))])
)
(send frame show #t)
(p.s the message-box can pop up a dialog – the same as (new dialog% [parent frame]))
So if we ignores the first question, can we show a modal dialog that disables parent’s menu bar?
Besides, is it really impossible to make a real modal dialog in racket/gui?
(I’m working on Win7)
Followup: it was a bug, and will be repaired.
References: