[racket-dev] strange/wrong placement and sizing in racket/gui

From: Marijn (hkBst at gentoo.org)
Date: Mon Jun 20 09:55:08 EDT 2011

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,

I have a couple of issues with current racket/gui behavior. I have
created the following test-case:


#lang racket/gui

(define list-editor%
  (class vertical-panel%
    (init init-values parent)
    (super-new (parent parent))

    (define (insert-item val)
      (let* ((v (new vertical-panel% (parent this) )) ;**
;             (ins (new button% (parent v) (label "insert")))
             )
        (new text-field% (parent this) (label "") (init-value val))) )

;    (send this begin-container-sequence)
    (for ((v init-values)) (insert-item v))
;    (send this end-container-sequence)

    )) ; end define class

(define root (new frame% (label "List Editor")))

(new list-editor% (parent root) (init-values '("1" "2" "3")))

(send root show #t)


1) If you run the program like this, then 3 wide text-fields are created
each with lots of empty space on top of it. The empty space shouldn't be
there.

2) Now uncomment the first commented line, the one that creates buttons
and run again. The texfields are now narrow and instead of empty space
there are now buttons. This case seems fine.

3) Now uncomment the begin/end-container-sequence lines and run again.
Suddenly the textfields are wide again and there is extra vertical space
in between the textfields and buttons. I don't think that
begin/end-container-sequence should ever influence the final result,
since they are only to prevent flickering due to too frequent on-screen
resizing.

4) Finally, it seems that (style '(border)) doesn't work for me when I
add it on the line marked ** as a property of the vertical-panel.

All this (tested) on Linux.

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3/UTwACgkQp/VmCx0OL2wBKwCgiOstXY8bJfRiWplxuWXIl2e/
gtYAniao8oxq9yOv14PMw/SaYgpjppk0
=Cn3z
-----END PGP SIGNATURE-----


Posted on the dev mailing list.