[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error on shutdown of widget !@$%
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
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
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
which overrides the KILL_NOTIFY. It also gets the widget ID as its
Do the cleanup in one of these procedures and just kill the widget in
event handler (the cleanup routine will be called then also.
;; uncomment the CLEANUP keyword for using xKill instead