On Thursday, March 2, 2017 at 4:16:47 AM UTC+8, Philip McGrath wrote:
> This seems like it should be a simple question, but I can't figure out how to 
> get a scroll bar in a gui application like this one:
> #lang racket/gui
> (define frame
>   (new frame% [label "Example"]))
> (for ([letter '("A" "B" "C" "D")])
>   (define grp
>     (new group-box-panel%
>          [parent frame]
>          [label letter]))
>   (for ([i (in-range 0 10)])
>     (new button%
>          [parent grp]
>          [label (number->string i)])))
> (send frame show #t)
> I can see something like what I have in mind in Dr. Racket's "Colors">"Color 
> Schemes" preferences tab (at least on Mac OS), but I can't figure out how to 
> do it.
> Thanks,
> Philip

Does this do what you want?

    #lang racket/gui

    (define frame
      (new frame% [label "Example"] [height 300]))
    (for ([letter '("A" "B" "C" "D")])
      (define grp
        (new group-box-panel%
             [parent frame]
             [min-height 100]
             [label letter]))
      (define panel
        (new vertical-panel% 
             [parent grp] 
             [style '(vscroll)] 
             [alignment '(left top)]))
      (for ([i (in-range 0 10)])
        (new button%
             [parent panel]
             [label (number->string i)])))
    (send frame show #t)

Best Regards,

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to