From: Bruce S. <Bru...@nc...> - 2008-03-25 15:06:23
|
Naming issues: A window containing VPython graphics is a VPython "display" object. By default, when you create a sphere or other displayable object VPython creates a display object named "scene". In documentation you'll find names like "sceneb" or "scene2" as examples of displays other than the default one. from visual import * box() # by default, a display named "scene" is created, with a box scene2 = display() sphere() # this sphere will appear in a second display named "scene2" It is the case that if you have display.exit = False, closing that display doesn't terminate the program. I guess you could watch for that display or its contents no longer existing as a signal to stop the program. Bruce Sherwood petro finder wrote: > Hi Bruce, > Now I can dispose my scene ..very happy :D > I dont read carefully the visual help ( on visual help write as sceneb > ...not scene , actually it's same ...) > > but when I clicked close is oke to close the scene but the program is > getting hang > there are code of animation.. > while 1: > rate(100) > for self.wave in self.waves: > ..bla..bla.. > it's came from visual example - wave.py > I think when I close the scene window, it was not clear all the process > that running within scene. > Question ..I should fixed the code ? or there are method of scene to > clear all process? > > Thank you very much. > > > > > > 2008/3/25, Bruce Sherwood <Bru...@nc... > <mailto:Bru...@nc...>>: > > I'm not quite sure what it is you want to do, and I don't recognize your > references to "WINDOW_ON_CLOSE" and "WINDOW_ON_EXIT", but here are two > relevant points: > > 1) As stated in the Visual help, setting scene2.exit = False means that > clicking the close box on the display named "scene2" closes that display > but doesn't halt the program and doesn't close other displays. > > 2) You can dispose of a display "scene2" by saying scene2.visible = > False, > > Bruce Sherwood > > |