[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Top window garbage collected in standalone?



Quoting Paul Fernhout:
> It appears the top level window seems to be immediately garbage
> collected because it opens up and then closes right away.

MrEd exits if its main thread runs out of expressions to evaluate,
regardless of whether any window is visible or any events are in the
event queue.

This is a consistent source of confusion, but we don't currently know a
better overall convention.

Some ways to fix the program:

 * Use dialog% instead of frame%. This works because the `show' menthod
   for dialog% blocks until the dialog is closed.

 * Put `(yield (make-semaphore 0))' at the end of the program, and
   explicitly call `(exit)' when the user closes the window (i.e.,
   override the `on-close' method of the frame%).

 * Use the -V command-line flag, which does the same thing as putting
   `(yield (make-semaphore 0))' at the end of the program.

Matthew