[plt-scheme] MrEd - grid alignment

From: riandouglas at iprimus.com.au (riandouglas at iprimus.com.au)
Date: Tue Dec 2 00:05:48 EST 2003

Some months ago I hacked up a (somewhat crippled) grid control (more like
a multi-column list control) by writing directly to the canvas.  Its pretty
ugly, but if you want I could post it to you.  I'm pretty sure it is not
good style, as I'm pretty new to scheme :-)

Rian Douglas

>-- Original Message --
>From: Robby Findler <robby at cs.uchicago.edu>
>To: Guenther Schmidt <gue.schmidt at web.de>
>Cc: plt-scheme at list.cs.brown.edu
>Subject: Re: [plt-scheme] MrEd - grid alignment
>Date: Mon, 1 Dec 2003 17:57:24 -0600
>
>
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>There isn't any grid alignment control, I don't believe. You coudl
>implement one by subclassing panel% (that's how horizontal-panel% and
>vertical-panel% are implemented). 
>
>Or, you could find the biggest min-width across the columns and set all
>of the min width in a column that number. That works well enough in
>many cases.
>
>Robby
>
>At Mon, 01 Dec 2003 23:45:54 +0000, Guenther Schmidt wrote:
>>   For list-related administrative tasks:
>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> 
>> Hi,
>> 
>> how do I align several items in a grid (table) layout?
>> 
>> code example:
>> 
>> (define frame (instantiate frame% ("Haushaltsbuch")))
>> 
>> (define check-input (instantiate vertical-pane% (frame) (alignment '(left
>center))))
>> 
>> (map (lambda (x)
>>        (let ((parent (instantiate horizontal-pane% (check-input) (alignment
>'(center center)))))
>>          (list
>>           (instantiate message% (x parent))
>>           (instantiate text-field% (#f parent void) (min-width 100) (stretchable-width
>#f)))))
>>      '("Betrag" "Empf?nger" "Verwendungszweck"))
>> 
>> (send frame show #t)
>> 
>> This unfortunately won't align to agrid though.
>> 
>> Guenther
>> 
>> 
>> 
>> 
>
>



Posted on the users mailing list.