[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: optional monitors



I'm working in MCL 2.0a5, so this code may not work in MACL 1.*.
The function window-manager-port is useful if you want to let the
user drag something anywhere around the screen:

(with-port (window-manager-port) [body])

You can also examine the window-manager port to find the size of
the screen.  But remember that this isn't alway simple because 
the two monitors together do not necessarily form a rectangular
space... one can be shifted up relative to the other.

I believe that there's a trap that you can call as well.  [Is it 
_sysenvirons?  I'm not sure.  I've never tried it.]

Good luck.

-- Amy Bruckman


;; this function is borrowed from interface tools:ift-macros.lisp
(defmacro window-manager-port ()
  '(%stack-block ((port 4))
     (_GetWMgrPort :ptr port)
     (%get-ptr port)))
;; For some reason, the variables *screen-height* and *screen-width* 
;; get the coordinates for only one screen.  The parameter
;; *screen-bottomright* is from the bounding box of the visible region
;; of the grafport, and will be correct for multiple screen systems. 
;; 
;; Note that since the visible region may not be rectangular, the bounding 
;; box may contain points which are not in the visible region.

(defparameter *screen-bottomright* 
  (rref 
   (rref (window-manager-port) :grafport.visrgn) 
   region.rgnbbox.bottomright))