The main way to avoid a default exit on Mac OS is to create a
`menu-bar%` with the parent 'root. That menu bar becomes active when no
windows (i.e., frames) are open.

Another way is to not rely on the implicit `(yield (current-eventspace))`
of a GUI executable, and instead use something like `(yield never-evt)`
so that the application doesn't exit until `exit` is used.

At Fri, 27 Apr 2018 12:39:21 -0500, Philip McGrath wrote:
> I know that, on Mac at least, it's expected behavior for the application to
> exit when all windows are hidden with `(send frame show #f)`. I personally
> think this is a great default, because it prevents the annoying behavior of
> other applications that hang around open even when you mean to have closed
> them unless you explicitly "quit". I believe there is a way to stop this
> from happening when it makes sense for the application to be able to exist
> with no windows (I think DrRacket does this, for example), but I've never
> tried.
> 
> I wonder, though, about what you say about using a tcp server in another
> thread: do you mean a Racket thread, a Racket place, or a machine thread
> through some other mechanism? Racket's threads are "green" — they all run
> in the same machine thread, giving you concurrency but not parallelism —
> so, if that's what you mean, you could communicate over a channel or other
> synchronization construct rather than converting messages to TCP-able
> bytes. Using the Racket constructs to communicate between Racket threads
> would certainly be more convenient than going through TCP, and probably
> more efficient as well.
> 
> -Philip
> 
> On Fri, Apr 27, 2018 at 12:21 PM, Tony Fischetti <[email protected]>
> wrote:
> 
> >
> > Hi all,
> >
> > I've been stuck on this for a while.
> > Short version: When I hide a GUI window with `(send frame show #f)` the
> > application (on a mac, at least) *exits* when I'd like it to just hide the
> > application and leave it still running.
> >
> > More information:
> > I'm developing a small (personal) application launcher on macOS to help me
> > learn Racket. Since I'd like the input window to come up lightning quick, I
> > currently have the application spin up a tcp server in another thread. It
> > responds to TCP events by hiding and showing the input window. Everything
> > works, except that when the main window is hidden, the application closes
> > and the server with it.
> >
> > Any ideas would be greatly appreciated! Thanks!!
> >
> > Tony
> >
> > --
> > 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 to [email protected].
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> 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 to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
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 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to