[plt-scheme] A Square Canvas

From: Jens Axel Soegaard (jensaxel at soegaard.net)
Date: Mon Jul 14 13:13:04 EDT 2008

Jens Axel Soegaard wrote:
> Robby Findler wrote:
>> Is the goal to have a stretchable canvas, but one that always stays
>> square? 
> Yes.
>> For that you'd need to make your own geometry manager, I'm
>> afraid. This is the relevant part of the docs:
>>
>> http://docs.plt-scheme.org/gui/windowing-overview.html#(part._new-containers) 
>>
>>   
> I'll take a look.

Here is a solution meant for the archives.

I have made an alternative to horizontal-panel%. The square-panel% 
behaves as a
horizon-panel% when respect to borders, margin, and vertical alignment.
The children all become quadratic. The stretchable children will be 
stretched
with the same magnification factor.

In my use case, where I needed a stretchable, quadratic canvas, all I 
need to do
is to place a single canvas as the only child of a square-panel%.

-- 
Jens Axel Søgaard

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: square-panel-test.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20080714/dcf7263c/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.png
Type: image/png
Size: 11622 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20080714/dcf7263c/attachment.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: square-panel.ss
URL: <http://lists.racket-lang.org/users/archive/attachments/20080714/dcf7263c/attachment-0001.ksh>

Posted on the users mailing list.