[plt-scheme] MrEd question: display image-snip% in a window; deinitialization

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Oct 5 22:57:28 EDT 2006

At Thu, 5 Oct 2006 20:52:13 -0600, "Chongkai Zhu" wrote:
> Basicly, it works. I do "(send series-editor enable #f)" because the user is 
> not supposed to move the image. But if the image is bigger than the editor, 
> the user is not able to scroll now. How should I enable it?

Instead of disabling the canvas, lock the `series' editor using the
`lock' method.

FWIW, `series-editor' is a slightly confusing name, since the object is
an instance of `editor-canvas%', not `editor<%>'. (At least, it
confused me at first.) I suggest `series-canvas'.

> 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



Posted on the users mailing list.