Another possibility is to set the stretchable-width of the message to #f, 
this way the message does not take more than its minimal required space.

#lang racket/gui

(define (example)
  (define frame (new frame% [label "Alignment example"] [width 400]))
  (define vbox  (new vertical-panel% [parent frame]))

  (define (test h-align)
    (define p (new horizontal-panel% [parent vbox] [alignment `(,h-align 
center)]))
    (new message% [parent p] [label (symbol->string h-align)] 
[stretchable-width #f]))

  (for-each test '(left center right))

  (send frame show #t))

(module+ main
  (example))


[image: RacketPanelAlignmentExample.png]

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1654c527-87df-4b5c-ac86-68f616c06733%40googlegroups.com.

Reply via email to