I have created a small Windows application in Racket starting with:
#lang racket
(require racket/gui)
(define frame (new frame%
... etc
with a few controls.
I compile it in a distribution (to run on other machines) with DrRacket menu "Racket / Create executable".
The application runs fine showing the expected frame when I double-click on its executable.
However there is always a secondary window, a console window, popping up at the same time. I want to get rid of this console window.
Any way to do that?
> In the "Create executable" dialog select "GRacket" as Base instead of "Racket". That way no console window pops up when you run the executable.
I tried again as you suggest but this time I got the GRacket console instead.
Then I had an idea, I put all my program inside a single function like:
(define (main)
(all other functions))
(main) ; and call the main function
And it works! No more console.
But... I wonder if there is a simpler way then wrapping the whole program inside a function like this?
Getting closer! :)
You got it right!
I was writing few controls like this:
(new menu-item% ...
which output (object:menu-item% ...) that triggers the console.
Writing this instead:
(define menu-a (new menu-item% ...
cures the problem even if 'menu-a' is never used.
Thanks!
UPDATE:
In the end, I found out I could simply write:
(void (new menu-item% ...