closing an x11 window

From: Ertl, John <john.ertl_at_nyahnyahspammersnyahnyah>
Date: Tue, 21 Dec 2004 06:15:22 -0800

I have a larger program that has a PyNGL function that uses the x11 window
to display a grid. Up until now I have only displayed one grid then the
program ended when I clicked on the image. Now I want to put the image code
into a loop (not an animation) but each x11 window stays up until the
program ends. When I click window the image goes away but the window is
still up. I have tired several unsophisticated python and PyNGL things
including the os.wait() and del map but no luck.

Does any one know how to get the x11 window to close with the program still
running? I have not been able to run the examples to see if I can reproduce
the problem with code provided but does any one have a suggestion.

John C. Ertl
Fleet Numerical Meteorology & Oceanography Center
7 Grace Hopper Ave
Monterey, CA 93943
phone: (831) 656-5704
fax: (831) 656-4363

    def view(self):
        wks = Ngl.open_wks("x11","ditch.test",None)
        rlist = Ngl.Resources()
        grid = self.binvalues

        grid_lon = Numeric.arange(0,360,.5)
        grid_lat = Numeric.arange(-90,90,.5)
        grid_nlon = len(grid_lon)
        grid_nlat = len(grid_lat)
        resources = Ngl.Resources()

        resources.sfXCStartV = min(grid_lon)
        resources.sfXCEndV = max(grid_lon)
        resources.sfYCStartV = min(grid_lat)
        resources.sfYCEndV = max(grid_lat)

        resources.cnFillDrawOrder = "Predraw" # Draw contours

        resources.cnLinesOn = False
        resources.cnFillOn = True # Turn on contour fill.
        resources.cnLineLabelsOn = False # Turn off line labels.
        resources.cnInfoLabelOn = False # Turn off info label.
        resources.lbPerimOn = False # Turn off label bar
        resources.mpPerimOn = True # Turn on map perimeter.

        map = Ngl.contour_map(wks,grid,resources)
pyngl-talk mailing list
Received on Tue Dec 21 2004 - 07:15:22 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 19 2006 - 21:30:17 MST