I have a problem with the Racket GUI where the main application window
focus if two dialog boxes are opened than closed. The problem occurs when
main window opens the first dialog box and the first dialog box opens the
second one on top of it. Once both dialog boxes are closed, the main window
looses focus and goes to the bottom of the window stack (i.e. behind other
windows). This does not seem to happen if only one dialog box is opened
closed -- in that case the main window will have the focus.
Could someone confirm if this behaviour is seen on other platforms (I use
Windows), and perhaps offer a workaround?
I attached a sample application that illustrates the problem below and you
also find the code here:
Too see the problem, this code needs to be compiled into a stand-alone
executable (using the Racket/Create Executable... from DrRacket).
(define toplevel (new frame%
[label "Hello World"]
(define dialog-1 (new dialog%
[label "Dialog 1"]
(define dialog-2 (new dialog%
[label "Dialog 2"]
(define (on-open-dialog1 button event)
(send dialog-1 show #t))
(define (on-close-dialog1 button event)
(send dialog-1 show #f))
(define (on-open-dialog2 button event)
(send dialog-2 show #t))
(define (on-close-dialog2 button event)
(send dialog-2 show #f))
(define b1 (new button%
[label "Open Dialog 1..."]
(define b2 (new button%
[label "Open Dialog 2..."]
(define b3 (new button%
[label "Close Dialog 1"]
(define b4 (new button%
[label "Close Dialog 2"]
(send toplevel show #t)
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.