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

Home » Public Forums » archive » Closing out of a Window
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Closing out of a Window [message #50348] Thu, 28 September 2006 09:30 Go to next message
ChristopherFlorio is currently offline  ChristopherFlorio
Messages: 23
Registered: April 2006
Junior Member
Does anyone know of a way to link the event of closing a GUI window
using the "x" with a procedure or function?
Re: Closing out of a Window [message #50463 is a reply to message #50348] Fri, 29 September 2006 11:34 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 28 Sep 2006 20:24:44 -0600, David Fanning wrote:

> JD Smith writes:
>
>> Great tip, Benjamin... came in handy, and removes the need for a "Cleanup".
>
> Well, the main problem with this method is that during
> development, if your program crashes, you can't exactly
> close the window easily. :-(

That's actually a good thing for me... I can use RETALL to get back in
action, and then kill it the old fashioned way (File->Close).
Formerly, I was letting the window get killed by the window manager,
asking to save changes if appropriate, and if "Cancel" is hit,
redisplaying the entire widget. This way is much cleaner.

JD
Re: Closing out of a Window [message #50471 is a reply to message #50348] Fri, 29 September 2006 09:52 Go to previous message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
ChristopherFlorio@gmail.com wrote:
> Does anyone know of a way to link the event of closing a GUI window
> using the "x" with a procedure or function?

My predecessor used this in all his widgets. Makes sense to me. Don't
know if it does an actual cleanup, but don't really care either.

if (TAG_NAMES(event, /STRUCTURE_NAME) eq 'WIDGET_KILL_REQUEST') then
begin
widget_control, event.top, /destroy
return
endif
Re: Closing out of a Window [message #50483 is a reply to message #50348] Thu, 28 September 2006 19:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith writes:

> Great tip, Benjamin... came in handy, and removes the need for a "Cleanup".

Well, the main problem with this method is that during
development, if your program crashes, you can't exactly
close the window easily. :-(

Not that I know this from experience or anything, of course.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Closing out of a Window [message #50486 is a reply to message #50348] Thu, 28 September 2006 15:53 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 28 Sep 2006 16:11:35 -0400, Benjamin Hornberger wrote:

> David Fanning wrote:
>> David Fanning writes:
>>
>>
>>> Oh, it can't possibly be that easy, can it? :-(
>>
>>
>> Humm. Well, I guess I knew that. But I still prefer the
>> old tried and true way of a CLEANUP routine. :-)
>>
>
> Of course you are right; I actually refered to the case where you want
> to inhibit the window being closed (e.g., if you want to have the
> closing confirmed), but forgot to mention that explicitly ...

Great tip, Benjamin... came in handy, and removes the need for a "Cleanup".
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Segmentation fault on Mac Intel Core 2 Duo
Next Topic: Re: READ TOMS AEROSOL

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

Current Time: Fri Oct 10 11:13:10 PDT 2025

Total time taken to generate the page: 0.64529 seconds