NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Garrett: If you can live with the method name "desty" then you don't need to define your own kill(). Just invoke desty(None) since the name "event" is not used. Your other change -- returning the myFrame object created -- could be made a permanent change, since the only downside is that when a "showDisplay()" is run from the command line, it would print out an str of that (whatever that might be). If that would be helpful and not too onerous, just let me know... Another option would be to make your own JFrame to hold the display and your "Close" button. Then create a JPanel and pass it's getContentPane() into showDisplay() as the last parameter -- that way showDisplay should just put the VisAD display in there for you. tom On Mon, 4 Mar 2002, Campbell, Garrett wrote: > I am using the jython scripts set up by Tom W. > I would like to close the display windows within the .py script. > > I did this by modifying the subs.py: > > def showDisplay(display, width=300, height=300, > title="VisAD Display", bottom=None, top=None, > panel=None): > mf=myFrame(display, width, height, title, bottom, top, panel) > return mf > > class myFrame: > > def desty(self, event): > self.display.destroy() > self.frame.dispose() > > def kill(self): > self.display.destroy() > self.frame.dispose() > .. > > then I can do mf.kill() > > This simulates the user clicking the window close icon. > > Is there a better way without modifying the semi standard routines in > subs.py and graph.py? > > G. Garrett Campbell Ph. D. > Cooperative Institute for Research in the Atmosphere > Colorado State University > Ft. Collins, CO, USA > 970 491 8497 > campbell@xxxxxxxxxxxxxxxxxx > -- Tom Whittaker University of Wisconsin-Madison Space Science and Eng. Center ph: 608.262.2759
visad
archives: