kagehi
Member in Training
Posts: 26
|
Post by kagehi on Feb 20, 2021 20:39:57 GMT
Been trying to fit my little dice roller application in the upper left of the screen on my computer, with discord open next to it. However, the variables UpperLeftX and UpperLeftY do not seem to work as they should. If I use values of 0,0 the resulting application location ends up being weirdly in the middle of the display, not in the corner, as requested. If I instead try to use 1,1, its "almost" right. Its one pixel below the display edge, but like 10 pixels, or so.. (not sure exactly), to the right of the edge of the display. I end up having, do to the size and position of controls in this thing, to drag it manually a bit to the left, so its not overlapping discord as a result. If I use 0,1, or 1,0, or it locates it "mid screen", on the axis that is using 0, and trying to trick it, with something like .5,.5 obviously is internally being rounded down, giving 0,0, which then.. dumps the window in the middle some place again. Doesn't seem to even be a way to "internally" set the position once its created, so I couldn't even move it to where it belongs with code after creation.
In any case, almost every example shown, so far, while trying to see if this was reported, seems to "want" to use an equation that positions the window in the exact center of the screen. So, is this just something now one has noticed before and a bug, or something?
|
|
|
Post by tsh73 on Feb 20, 2021 20:51:39 GMT
I confirm this behaviour on Win10 Then requested 1,1 it sets to 9,1 instead.
UpperLeftX=1 UpperLeftY=1 open "test" for window as #main #main "trapclose [quit]" wait
[quit] close #main end
|
|
kagehi
Member in Training
Posts: 26
|
Post by kagehi on Feb 20, 2021 21:35:43 GMT
And the 0,0? I can't get exact numbers off it, but I have a display size of 1920x1080. Using the following code it "seems" to end up being created at x = 960 and y = 429, maybe? The values of the variables don't change at all, but the actual location seems to be actually 50% of the screen width, if the window is small enough, and with the bottom of the window a pixel above the screen size, in the case of my code. Haven't tried it, but.. given the behavior I suspect it would also place it at 50% the height of the display too. Kind of in the middle of a RP game so, not able to test it at the moment. But, it does seem to have positioned it at 1080 / 2 - WindowHeight - 1, near as I can tell. UpperLeftX = 0 UpperLeftY = 0 WindowWidth = 990 WindowHeight = 650 Open "Vinder" for window as #Dice
|
|
|
Post by tsh73 on Feb 20, 2021 22:16:11 GMT
IMHO if you set
UpperLeftX = 0 UpperLeftY = 0 it works the same as you do NOT set any coordinates. That is, Windows places it by itself (and for me it looks like it is placed top left corner near mouse position)
EDIT if mouse is too low then it positioned to notto go off-screen, that explanes your big window stays half screen
Anyway. 0,0 does not work as 0,0. If you really need it there is command-line tools to command over window placement.
|
|
kagehi
Member in Training
Posts: 26
|
Post by kagehi on Feb 20, 2021 22:22:10 GMT
Hmm. OK. This is a bit frustrating though, since it means you can't position the window at 0,0 then, short of moving it. Maybe it should have been set so that if you used -1,-1 it "let windows set its position", but 0,0 was literal? Seems like an odd decision to have it work the way it does to me. But, then, there are quite a few things in JB that I find frustrating and make no sense to me. lol
|
|
|
Post by cundo on Feb 21, 2021 1:15:14 GMT
I need to test this (tomorrow), I remember working ok on my codes.
|
|
|
Post by tsh73 on Feb 21, 2021 8:35:46 GMT
OK Regarding "8 pixels left gap" I run it on Xp - window has rather thick border, border starts at 1,1 Win 7 - window has even more thick border, border starts at 1,1 Win 10 - it is still the thick border as in Win7 but it is TRANSPARENT It behaves like border - resizes, you cannot click though it (you can fall to lower window only on last (0) pixel JB does not let you position)
And I tried it in VB.NET 2010 - on Win 10 it shows same 8 or 9 pixel gap. (but VB supports negative coordinates to you still can move it)
So it looks like it is a border Try window_nf to get smaller border or window_popup to run without border (ant window titlebar) at all.
|
|
kagehi
Member in Training
Posts: 26
|
Post by kagehi on Feb 21, 2021 9:15:43 GMT
Hmm. So, its a Windows 10 idiocy.. Thus not really fixable. Yeah, in this specific case I could do with window_nf, maybe even window_popup, but this isn't likely to always be the case. I like the fast turn around, without a recompile, you can get with JB, but... its starting to look like some issues are only "solvable" by going to full VB.
|
|