Open sorawee opened 3 years ago
You can already achieve that layout by using separate message%
objects for the labels and a custom panel%
type. There's table-panel available as a package, but I haven't used that. I also wrote my own grid-pane% for this purpose and you can use it like this:
#lang racket/gui
(require "grid-pane.rkt")
(define toplevel (new frame% [label "Hello"] [width 300] [height 100]))
(define p (new grid-pane%
[parent toplevel]
[columns 2] ;; children are placed in two columns
[spacing 5]
[border 5]
[alignment '(left center)]))
(new message%
[parent p]
[label "Font Name"])
(new choice%
[parent p]
[label ""]
[choices '("Menlo")]
[stretchable-width #t])
(new message%
[parent p]
[label "Font Smoothing"])
(new choice%
[parent p]
[label ""]
[choices '("Use system-wide default")]
[stretchable-width #t])
(new message%
[parent p]
[label "Weight"])
(new choice%
[parent p]
[label ""]
[choices '("Normal")]
[stretchable-width #t])
(send toplevel show #t)
Your grid-pane%
is published under GPL-3+, so it's not quite a replacement for this feature being in the gui package.
If anything, it's worth warning people that they should not look at your implementation if they wish to fix this issue in order to not write derived code that would then violate the GPL-3+ license if published as Apache-2 or MIT.
When labels are specified in controls like
text-box%
, the controls are put right after the labels, causing the layout to look weird.In contrast, this is how the controls are usually aligned in most applications.