next up previous contents
Next: File ``valuedialogs.scm'' Up: Appendix B: Listing Previous: File ``aboutbox.scm''   Contents

File ``gui_helper.scm''

;;--------------------------------------------------------------------------
;; AriNET Project in Informatics IA by Dominique Guinard
;; dominique.guinard@unifr.ch
;;--------------------------------------------------------------------------
;; gui helper functions
;;--------------------------------------------------------------------------

; ------------------------------------------------------------
; ABSTRACT:
; *********
; This files contains the functions used to center and to
; size the windows.
; ------------------------------------------------------------


; ------------------------------------------------------------
; get center
; ------------------------------------------------------------


(define (get-center-position axis x y)
  (let-values (((width height) (get-display-size)))
    (if (eq? axis 'x)
        (round (/ (- width x) 2))
        (round (/ (- height y) 2)))))

; ------------------------------------------------------------
; end of get center
; ------------------------------------------------------------

; ------------------------------------------------------------
; get display divided size
; ------------------------------------------------------------

(define (get-display-divided-size axis divider)
  (let-values (((width height) (get-display-size)))
    (if (eq? axis 'x)
        (round (/ width divider))
        (round (/ width divider)))))

; ------------------------------------------------------------
; end of get display divided size
; ------------------------------------------------------------


;;--------------------------------------------------------------------------
;; end of gui helper functions
;;--------------------------------------------------------------------------



dominique 2003-06-02