[Gambas-user] Screen.class could do with "TotalWidth" or something

Bruce Steers bsteers4 at gmail.com
Mon Oct 31 17:16:55 CET 2022


On Mon, 31 Oct 2022 at 15:06, Bruce Steers <bsteers4 at gmail.com> wrote:

> aah , i just noticed the Screens array :-\
> my apologies
> BruceS
>

Hmm. i cannot do much with it.
The biggest block is with Me.Window.Screen
if i move a window across screens and inspect Me.Window.Screen it has the
value of the screen i am on either 0 or 1.

At application start though Me.Window.Screen is always 1 , even if the IDE
or application is started on screen 0

This stops me being able to detect screen at launch and move accordingly,
and also hints as to why ALL my gambas apps pop up windows and dialogs on
Screen[1] and not the applications screen.

Something like this should work..

iOpenOn = Me.Window.Screen
Me.Left = ((Screens[iOpenOn].W - Me.W) / 2) + Screens[iOpenOn].X
Me.Top = ((Screens[iOpenOn].H - Me.H) / 2) + Screens[iOpenOn].Y

I thought that "should" detect the screen i am on and centralize the window
on that screen at startup but it always uses Screens[1]

Can you do anything Ben to set Me.Window.Screen on init and not just after
manually moving the window? this could solve some issues.

Many thanks
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221031/acd2384a/attachment-0001.htm>


More information about the User mailing list