[racket] On gui

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jan 8 18:59:39 EST 2013

At Fri, 04 Jan 2013 17:40:10 +0100, heraklea at gmx.de wrote:
> Hello friends,
> 
> after some hacking I try to make an example gui project, in which I try to 
> understand the layout and the other stuff. When you start the program in the 
> attached file you see a canvas on the left side with some colored rectangles. 
> When I make an enter on canvas I resize the MainWindow.
> Question: How can I resize the canvas instead of frame? There is no method like 
> setSize or setFixedSize or what ever.

You can use `min-width' and `min-height', combined with making the
canvas and its containers non-stretchable via `stretchable-width' and
`stretchable-height'.

> The event on-scroll seems to be inactive or how can I grab the event?

To use `on-scroll', you need to enable manual scrollbars with
`init-manual-scrollbars'. (I'll add a cross-reference from the
`on-scroll' docs.)

> And I have try to use the suspend-flush and resume-flush things to avoid 
> flickering when I grap the splitter between the canvas and the button.
>
> Same thing seems to happen in DrRacket when I pull the splitter up and down 
> between the output pane and the definition pane. Isn´t it?

I think you'll need the 'no-autoclear style for the canvas.

That's apparently not enough when the frame size is being resized via
`resize' on Mac OS X, though. Probably `racket/gui' doesn't support a
non-flickering resize that way.



Posted on the users mailing list.