[plt-scheme] MrEd question: display image-snip% in a window; deinitialization
Thanks for the quick reply.
By "Override the `on-close' method of the frame", do you mean:
(define my-frame%
(class frame%
(override on-close)
(define (on-close)
;my deinitialization code here
(super on-close))))
? If yes, I get the following error message:
class*: superclass method for override, overment, or rename-super is not overrideable: on-close for class: my-frame%
Sincerely,
Chongkai
----- Original Message -----
From: "Matthew Flatt" <mflatt at cs.utah.edu>
To: "Chongkai Zhu" <czhu at cs.utah.edu>
Cc: "pltscheme" <plt-scheme at list.cs.brown.edu>
Sent: Friday, October 06, 2006 10:57 AM
Subject: Re: [plt-scheme] MrEd question: display image-snip% in a window;deinitialization
>> The second question is, when the user closes the main (and the only) frame by
>> click the "X" on the title bar, how could I ask the program to do some extra
>> deinitialization work? I tried the "application-quit-handler", but failed to
>> figour out the "initial eventspace" thing. And my GUI doesn't use a menu.
>
> Override the `on-close' method of the frame. Or override `can-close?'
> if your extra work sometimes needs to cancel the close.
>
> Matthew
>
>