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

Home » Public Forums » archive » Re: Error on shutdown of widget !@$%
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: Error on shutdown of widget !@$% [message #24642 is a reply to message #24626] Tue, 10 April 2001 03:52 Go to previous messageGo to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Sean Heukels wrote:
>
> How do I get rid off, or catch this error ??
>
> When I shutdown my widget program by clciking exit, in my menubar, I can
> reset colors, structures, the whole thing.
> But when I click the Top-right-cross (Windows) And top-left=box on Unix,
> which shutsdown the current process, I get an error by widget_event,
> that this one ('named by number') is not defined.
>
> I wish to clean up the variables that I clean on pushing exit in the same
> way and dont want 2 create errors.
>
> How can this be done ??
>
> Thnks Sean

The problem here is, that when you kill the widget by the
window-manager,
your widget doesn't exist anymore when you want to read data from it.
You can define a procedure for the top level base via the KILL_NOTIFY
keyword
which will be called when the widget dies, no matter how.
This procedure gets the widget ID of the dying widget as an argument.
Alternatively you define a cleanup procedure via the CLEANUP keyword to
xmanager,
which overrides the KILL_NOTIFY. It also gets the widget ID as its
argument.
Do the cleanup in one of these procedures and just kill the widget in
the
event handler (the cleanup routine will be called then also.

Cheers,
marc

Example:

pro testKill,ID
print,'testKill'
print,widget_info(/VALID_ID,ID)
end

pro xKill,ID
print,'xKill'
print,widget_info(/VALID_ID,ID)
end

pro test_Event,event
widget_control,event.top,/DESTROY
end

pro test

tlb=widget_base(/COL,KILL_NOTIFY='testKill')

wb=widget_button(tlb,VALUE='--------------OK------------')

widget_control,tlb,/REALIZE

;; uncomment the CLEANUP keyword for using xKill instead
xmanager,'test',tlb;,CLEANUP='xKill'
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Function BYTSCL
Next Topic: IDL programming position in San Francisco

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

Current Time: Wed Oct 08 15:48:11 PDT 2025

Total time taken to generate the page: 0.00443 seconds