Re: [racket-users] frame width and (get-display-size) ...

2021-08-06 Thread George Neuner


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 racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/e5b86730-d78c-d445-2fa2-b2b78b632f77%40comcast.net.


Re: [racket-users] frame width and (get-display-size) ...

2021-08-05 Thread Jens Axel Søgaard
Which OS?



Den tor. 5. aug. 2021 kl. 17.36 skrev Don Green :

> Creating a frame width that is half of the width given by
> (get-display-size), then moving the resulting window to the right and left
> of the screen you can see that if you had 2 windows of the same size they
> would not touch each other as you would expect.
> For some reason, dividing the total pixel width in HALF, DOES NOT give 2
> windows that will fill the space.
> ;Instead there is a mysterious gap that happens to be about the width of
> the O.S. vertical toolbar.
> Can anyone explain?
> Thanks
>
> --
> 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/1e605128-50b3-4578-bf60-2aaa68016006n%40googlegroups.com
> 
> .
>


-- 
-- 
Jens Axel Søgaard

-- 
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/CABefVgw-AyTD_m1oo62rfUg1y2bSy0gCobjW58GU-rUKV%2BUX6w%40mail.gmail.com.


[racket-users] frame width and (get-display-size) ...

2021-08-05 Thread Don Green
Creating a frame width that is half of the width given by 
(get-display-size), then moving the resulting window to the right and left 
of the screen you can see that if you had 2 windows of the same size they 
would not touch each other as you would expect.
For some reason, dividing the total pixel width in HALF, DOES NOT give 2 
windows that will fill the space.
;Instead there is a mysterious gap that happens to be about the width of 
the O.S. vertical toolbar.
Can anyone explain?
Thanks

-- 
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/1e605128-50b3-4578-bf60-2aaa68016006n%40googlegroups.com.