screenRect and screenLoc weirdness

Brian Milby brian at milby7.com
Thu Jan 10 20:03:56 EST 2019


You may want to use the “effective topLeft” though. Otherwise the title bar of the window could be off screen.

Thanks,
Brian
On Jan 10, 2019, 6:42 PM -0600, Knapp Martin via use-livecode <use-livecode at lists.runrev.com>, wrote:
> I will give those a spin - thanks Monte.
>
> Marty
> > On Jan 10, 2019, at 4:39 PM, Monte Goulding via use-livecode <use-livecode at lists.runrev.com> wrote:
> >
> >
> >
> > > On 11 Jan 2019, at 11:16 am, Knapp Martin via use-livecode <use-livecode at lists.runrev.com> wrote:
> > >
> > > I was merely using that as an example. In my app I too place a toolbar in the topLeft corner of the screen by setting the topLeft of the stack to 0,0. On a single screen setup it works fine. But I've just discovered that on a multi-monitor setup as I've described, the toolbar isn’t even visible it’s so far off. So in this case 0,0 is not the top left corner of the main monitor. How so I arrive at that point? How do I determine the actual middle of the screen? Since I don’t understand all the dynamics of how these things are being determined I have not been able to arrive at a work-around to place things where I’d like them on the screen.
> >
> > — set the topLeft of a stack to the topLeft of its screen below the menubar:
> > set the topLeft of stack “Foo” to item 1 to 2 of line (the screen of stack “Foo”) of the effective working screenRects
> >
> > — set the topLeft of a stack to the topLeft of the main screen below the menubar
> > set the topLeft of stack “Foo” to item 1 to 2 of the effective working screenRect
> >
> > — set the loc of a stack to the center of its screen
> > local tLoc, tRect
> > put line (the screen of stack “Foo”) of the screenRects into tRect
> > put item 1 of tRect + (item 3 of tRect - item 1 of tRect) div 2, \
> > item 2 of tRect + (item 4 of tRect - item 2 of tRect) div 2 into tLoc
> > set the loc of stack “Foo” to tLoc
> >
> > — set the loc of a stack to the center of the main screen
> > set the loc of stack “Foo” to the screenLoc
> >
> > Hope these help! FWIW these should remain correct even if the general consensus is that the desktop space should have an 0,0 origin for the main screen.
> >
> > Cheers
> >
> > Monte
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list