[plt-scheme] MrEd - grid alignment

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Dec 1 18:57:24 EST 2003

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.