[plt-scheme] can't get height right when making a widget for mred

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Sep 21 09:42:40 EDT 2007

At Fri, 21 Sep 2007 14:35:04 +0100, "Stephen De Gabrielle" wrote:
> I'm trying my hand at making a simple widget.
> I've done something wrong and it is twice as high as it should be.
> Please look at my code below and let me know where I have gone wrong.

You are creating four widgets:

 * A frame that contains

     * A pane (of min height 200)

     * A pane that contains

         * A canvas (of min height 200)

Since the canvas is not nested in the first pane, the frame is
constrained to be 400 pixels tall.

I think you probably meant to make the canvas a child of the first
pane, instead of having two panes. To do that, move the
`super-instantiate' for the enclosing pane% class to before the
creation of the canvas% instance, and get rid of the `pane' definition,
and change the `parent' canvas% argument from `pane' to `this'.


Posted on the users mailing list.