|
Re: Closing out of a Window [message #50463 is a reply to message #50348] |
Fri, 29 September 2006 11:34  |
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  |
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  |
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  |
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".
|
|
|