| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Sorry for what's probably a question with an obvious answer in the documentation. I'm running IDL remotely using x-windows, using multiple calls to xobjview. At some point, my Mac seems to decide that there are two many x-windows open and crashes. Is there a way for IDL to close such an xwindow, or alternatively, close the window that xobjview opens. The relevant part of the code is below. Bascially, I'm using direct objects to write to a tiff file, at which point I'd like to kill the window (or xwindow) that xobjview has opened..... Thanks, Mark pro make_tiff,main,m,k sub_loadct,19,r,g,b ,/brew !p.background=fsc_color('Powder Blue') data=main(m).flux(*,*,k) data=rotate(data,1) ;need to rotate by 90 degrees to get it to come out right data0 =1.*data0 +replicate(0.,!xss,!yss) blah blah blah oModel = OBJ_NEW('IDLgrModel') MESH_OBJ, 4, vertices, connectivity, radii, /CLOSED sphericalCoordinates = CV_COORD(FROM_RECT = vertices, /TO_SPHERE) elevation = REFORM(sphericalCoordinates[2, *], N_ELEMENTS(sphericalCoordinates[2, *])) MESH_OBJ, 4, colrad, connectivity, cols, /CLOSED sphericalCoordinates = CV_COORD(FROM_RECT = colrad, /TO_SPHERE) col_elevation = REFORM(sphericalCoordinates[2, *], N_ELEMENTS(sphericalCoordinates[2, *])) oPalette = OBJ_NEW('IDLgrPalette',r,g,b) oPolygon = OBJ_NEW('IDLgrPolygon', vertices, POLYGONS = connectivity, SHADING = 1, $ VERT_COLORS =col, PALETTE = oPalette) oModel -> Add, oPolygon mylight1 = OBJ_NEW('IDLgrLight', TYPE=0, COLOR=[255,255,255]) ; Ambient white mymodel = OBJ_NEW('IDLgrModel') mymodel->Add, mylight1 XOBJVIEW, oModel, /BLOCK, SCALE = 1, $ TITLE =' RSPOT/NG = '+!crspot(m)+'/'+!cng(m), background=[210,210,210], $ ;[176,224,230], $ / just_reg,xsize=xsize,ysize=ysize,xoffset=0,yoffset =0,stationary=mymodel,tlb=tlb XOBJVIEW_ROTATE, [0, 0, 1], -(k+1)*.25, /PREMULTIPLY; XOBJVIEW_ROTATE, [0, 1, 0], (k+1)*1, /PREMULTIPLY; xobjview_write_image,'trash1.tiff','tiff' return end |
|
#2
| |||
| |||
| Mark writes: > I'm running IDL remotely using x-windows, using multiple calls to > xobjview. At some point, my Mac seems to decide that there are two > many x-windows open and crashes. Is there a way for IDL to close such > an xwindow, or alternatively, close the window that xobjview opens. You could use the TLB keyword to get back the identifier of the top-level base widget used to create the "window". But you will have to remove the BLOCK keyword to get this to work. After you have written your image, just call Widget_Control, tlb, /Destroy to destroy XObjView. Note that the object hierarchy you passed to XObjView is *not* destroyed when XObjView is destroyed. So you will have to do that separately. Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming (www.dfanning.com) Sepore ma de ni thui. ("Perhaps thou speakest truth.") |
|
#3
| |||
| |||
| On Aug 28, 12:31*pm, David Fanning <n...@dfanning.com> wrote: > Mark writes: > > I'm running IDL remotely using x-windows, using multiple calls to > > xobjview. At some point, my Mac seems to decide that there are two > > many x-windows open and crashes. Is there a way for IDL to close such > > an xwindow, or alternatively, close the window that xobjview opens. > > You could use the TLB keyword to get back the identifier of > the top-level base widget used to create the "window". But > you will have to remove the BLOCK keyword to get this to > work. After you have written your image, just call > Widget_Control, tlb, /Destroy to destroy XObjView. Note > that the object hierarchy you passed to XObjView is *not* > destroyed when XObjView is destroyed. So you will have > to do that separately. > > Cheers, > > David > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming (www.dfanning.com) > Sepore ma de ni thui. ("Perhaps thou speakest truth.") Works like a charm, David, thanks! I'll have to reread your book again. I should have caught onto the tlb keyword.... |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.