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

Re: Monitor Locations

At 10:24 AM 8/16/93 -0400, Mark A. Tapia wrote:
>On Sun Aug 15 15:19:20 1993 Laura Allender writes
>   Is there a way in MACL (or toolbox calls)
>   to find out the size of the current monitors
>   and the appropriate coordinates for the upper left hand corner
>   of those monitors?
>The short answer is to use the #_getdevicelist and #_getnextdevice traps.
>Here is  code that will do what I think you want for all of the gdevices
>on the device list.

Mark's code will do what you want, but MCL has some internal undocumented
functions that allow you do it with less code. These functions are in
the file "MCL 2.0 CD:Additional MCL Source Code:lib:colors.lisp".

(defun find-screen-positions-and-sizes ()
  "Returns a list of 2-element lists, each containing two points:
the position & size of one of your Mac's screens"
  (let ((res nil))
    (ccl::do-screens (screen)
      (push (list (ccl::screen-position screen)
                  (ccl::screen-size screen))