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

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Thu Oct 5 22:52:13 EDT 2006

Hi all,

I'm working on a program which needs to display several images in a GUI.

Now I do it as:

(define series
  (new pasteboard%))

(define series-editor
  (instantiate editor-canvas%
    (editor series)
    (style '(auto-vscroll auto-hscroll))
    (enabled #f)
    (min-width 450)
    (min-height 90)))

(define (update image) ;image is a image-snip%
             (send series-editor enable #t)
             (send series erase)
             (send series insert image 0 0)
             (send series-editor enable #f))

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?

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.

Thans for any help.


Posted on the users mailing list.