From: Bruce S. <Bru...@nc...> - 2008-03-25 03:55:05
|
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, then scene2 = None. Python maintains a count of references to every object. For example, a = [1, 2, 3] and b = a means that there are two references to the list. If you then say b = 5 or b = None, there is only one reference to the list. If you then also say a = 3 or a = None, there are no references to the list, no way to refer to the list, and Python is free to delete the list from memory and free up that memory. In Visual, there's one extra reference in the reference count of an object or display, namely the human viewer. If a = sphere(), the reference count for the sphere object is 2. If you then say a = None, the reference count decrements to 1 (the human viewer), and the sphere will not be deleted by Python. If you do want to delete the sphere from memory, first say a.visible = False, then a = None; this will decreases the number of references to the sphere to zero. Here is the summary in the Visual help: Deleting an Object To delete a Visual object just make it invisible: ball.visible = 0 Technical detail: If you later re-use the name ball, for example by creating a new object and naming it ball, Python will be free to release the memory used by the object formerly named ball (assuming no other names currently refer to that object). Bruce Sherwood petro finder wrote: > Hi All, > > I am calling scene to display an object from tk, I know how to hide / > visible the scene > but i don't know how to close or dispose the scene without exit all > programs. > I click at up right conner button of the scene to dispose/close it but > it exit all programs/tk main program! > I look at the documentation of visualpython there is no explanation of > WINDOW_ON_CLOSE, WINDOW_ON_EXIT ..etc on the scene. i use visualpython > ver2.5-3.2.11 > Does someone can show me a simple program to dispose the scene which > call from a method ? > or tell me where is good documentation/references. > > Thank you very much > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |