I have no idea what this code will do on MacOS, but it works on Windows
... at least for the limited window tilings I tried.
YMMV.
-------------------------------------
#lang racket
(require racket/gui)
(define-values (w h) (get-display-size #:monitor 0))
(printf "screen: ~a ~a~n" w h)
(set! w (/ w 2))
(set! h 100)
(define f1 (new frame% [label "Window 1"] [height h] [width w] [y 0] [x 0]))
(define f2 (new frame% [label "Window 2"] [height h] [width w] [y h] [x w]))
(define f3 (new frame% [label "Window 3"] [height h] [width w] [y (+ h
h)] [x 0]))
(define (align frm)
(let*-values [
((wx) (send frm get-x))
((wy) (send frm get-y))
((ww wh) (send frm get-client-size))
((dx dy) (send frm client->screen 0 0))
]
(printf "~s:~n" frm)
(printf "~a,~a ~a ~a~n" wx wy ww wh)
(printf "~a,~a~n" dx dy)
(printf "~n")
(let ((dx (- wx dx)))
(send frm move (+ wx dx) wy))
(send frm resize
(+ w (abs (- ww w)))
(+ h (- h (+ wh (- dy wy))))
)
(send frm show #t)
))
(align f1)
(align f2)
(align f3)
-------------------------------------
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/e5b86730-d78c-d445-2fa2-b2b78b632f77%40comcast.net.