adamleesaintfrancis / spacewar

Automatically exported from code.google.com/p/spacewar
0 stars 0 forks source link

Simulation does not end when gui is closed. #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start a game of spacewar with the gui on.
2. Close the gui using the close button of the frame decoration.
3. The simulation is still running in the background.

What is the expected output? What do you see instead?
When the gui is on, the simulation should end when the gui is closed.
Instead, it continues to run.

What version of the product are you using? On what operating system?
Ubuntu 8.4 beta.

Please provide any additional information below.

This is a minor bug, but annoying.

If this is the intended behavior, pleas ignore this.

To fix, in the runGUI() method of edu.ou.mlfw.World, in the body run()
method of the first anonymous Runnable() on line 174, make the following
change:

.
.
.
try {
      javax.swing.SwingUtilities.invokeAndWait(
            new Runnable() { public void run() 
            {
              final Viewer viewer = new Viewer(gui);
                  viewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

.
.
.

Also, please cc: jfager on any new issues that are opened!  Thank you!

Original issue reported on code.google.com by ztidw...@gmail.com on 31 Mar 2008 at 3:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Attached is a patch to fix this issue.

Original comment by ztidw...@gmail.com on 31 Mar 2008 at 7:19

Attachments:

GoogleCodeExporter commented 9 years ago
Good catch, thanks.  

Original comment by jfa...@gmail.com on 1 Apr 2008 at 2:52