how to know 2 monitors are in use?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

how to know 2 monitors are in use?

Post by richmond62 » Fri Sep 28, 2018 4:33 pm

Someone wrote elsewhere:

"During "development" on Windows with 2 monitors, how to use "set the loc of
this stack to the screenloc" so that a stack centres in on one or the other
monitor? (And, if not in the development environment? say, a standalone?)"

Here is a stack that gives you the location of monitor centres in a way that LiveCode
can use to position stacks in the centres of supplementary monitors.
MIDDLES.livecode.zip
Here's the stack.
(3.69 KiB) Downloaded 107 times
Last edited by richmond62 on Sun Nov 25, 2018 3:13 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: how to know 2 monitors are in use?

Post by richmond62 » Sat Sep 29, 2018 1:31 pm

Had a rather satisfying fight with my ISP and it got its act together again, so I can upload what I wanted to upload yesterday.
-
Middles.png
-

Code: Select all

on mouseUp
   put empty into fld "VIDZ"
   put empty into fld "VIDZ2"
   put the screenRects into fld "VIDZ"
   put 1 into VDUZ
   repeat until line VDUZ of fld "VIDZ" is empty
      put item 1 of line VDUZ of fld "VIDZ" into VW1
      put item 3 of line VDUZ of fld "VIDZ" into VW2
      put ((VW2-VW1)/2) into WIDD
      put (((VW2-VW1)/2)+VW1) into WIDD2
      put item 2 of line VDUZ of fld "VIDZ" into VH1
      put item 4 of line VDUZ of fld "VIDZ" into VH2
      put ((VH2-VH1)/2) into HITE
      put (((VH2-VH1)/2)+VH1) into HITE2
      put " screen centre at" && WIDD & "," && HITE after line VDUZ of fld "VIDZ"
      put " screen centre at" && WIDD2 & "," && HITE2 after line VDUZ of fld "VIDZ2"
      add 1 to VDUZ
   end repeat
end mouseUp

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: how to know 2 monitors are in use?

Post by richmond62 » Sat Sep 29, 2018 9:05 pm

Improved version:
-
MIDDLES2.png
-
MIDDLES.livecode.zip
here's the stack.
(15.41 KiB) Downloaded 112 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”