From: David S. <dsc...@vi...> - 2002-01-25 15:15:45
|
You can simply check scene.visible in your main loop. When it becomes 0, the window has been closed. Then you have a choice of either removing each object as Bruce suggested, or just creating a new display window (with display()) and drawing new objects in that one. Dave > -----Original Message----- > From: vis...@li... > [mailto:vis...@li...] On > Behalf Of Bruce Sherwood > Sent: Friday, January 25, 2002 9:26 AM > To: vis...@li... > Subject: Re: [Visualpython-users] Repeating VPython > simulation multiple times > > > I gather from a later note that the issue isn't how to delete all the > objects in a window (which would be to make them invisible, > looping through > scene.objects, not set them to None; see the section in the online > documentation on deleting objects), but rather how to detect > when the user > has clicked the close box, for which I don't know a mechanism. > > Bruce Sherwood > > --On Friday, January 18, 2002 11:10 -0600 Young-Jin Lee > <yl...@ui...> > wrote: > > > When I manually set "scene.visible" to "1" for later > simulation, the > > VPython simulation window appeared. But VPython objects > created in the > > previous simulation were still there. I tried to set all > the spheres > > created in the previous simulation by setting them to None, > it didn't > > work. Is there any way to clear all the objects in the > scene when it > > is closed? > > > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |