comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Is that window open??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is that window open?? [message #8570 is a reply to message #8562] Wed, 02 April 1997 00:00 Go to previous messageGo to previous message
hegde is currently offline  hegde
Messages: 17
Registered: December 1995
Junior Member
In article <33427754.41C6@irc.chmcc.org>, Phil Williams <williams@irc.chmcc.org> writes:
> How would I check to see if a window ID is still open in a widget
> program?
>
> Here's what I did
> oldwin = !d.window
> wset, info.wid
>
> ; some code here
>
> ;--- restore the oldwin
> wset, oldwin
>
> and it crashes with
> % WSET: Window is closed and unavailable.

Use CATCH to trap the error signal and act accordingly. For example:

oldwin = !d.window
WSET, info.wid

; some code here

CATCH, err_status
CASE err_status OF
-324 : BEGIN
; do what you want when the window is closed
PRINT, 'warning ........'
END

ELSE : WSET, info.wid
ENDCASE

CATCH, err_status, /CANCEL

As in any other structured language, IDL doesn't define these error signals
as constants. Hence programmer is at a disadvantage, if RSI changes them with
each version.

Hope it helps.

-M. Hegde
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: file paths
Next Topic: Re: ANY LINUX IDL USERS?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 07:53:59 PDT 2025

Total time taken to generate the page: 0.23608 seconds