-
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
(require racket/class
|
||||
"wv-window.rkt"
|
||||
"private/utils.rkt"
|
||||
)
|
||||
|
||||
(provide wv-dialog%
|
||||
@@ -18,29 +19,25 @@
|
||||
(super-new)
|
||||
|
||||
(define/override (init-size)
|
||||
(displayln "init-size")
|
||||
(dbg-webview "init-size")
|
||||
(let ((px (get-field x parent))
|
||||
(py (get-field y parent))
|
||||
(pw (get-field width parent))
|
||||
(ph (get-field height parent))
|
||||
)
|
||||
(displayln px)
|
||||
(displayln py)
|
||||
(displayln pw)
|
||||
(displayln ph)
|
||||
(dbg-webview "geom: ~a, ~a; ~a, ~a" px py pw ph)
|
||||
(let ((dw (send settings get 'width (if (eq? width #f) (default-w) width)))
|
||||
(dh (send settings get 'height (if (eq? height #f) (default-h) height)))
|
||||
)
|
||||
(displayln dw)
|
||||
(displayln dh)
|
||||
(dbg-webview "size: ~a, ~a" dw dh)
|
||||
(let ((xx (/ (- pw dw) 2))
|
||||
(yy (/ (- ph dh) 2)))
|
||||
(let ((x (inexact->exact (round (exact->inexact (+ px xx)))))
|
||||
(y (inexact->exact (round (exact->inexact (+ py yy)))))
|
||||
)
|
||||
(displayln (format "move ~a ~a" x y))
|
||||
(dbg-webview "move ~a ~a" x y)
|
||||
(send this move x y)
|
||||
(displayln (format "resize ~a ~a" x y))
|
||||
(dbg-webview "resize ~a ~a" dw dh)
|
||||
(send this resize dw dh)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user