Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Miniwindows Position

Miniwindows Position

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rene   (46 posts)  Bio
Date Thu 07 Jun 2018 11:44 PM (UTC)
Message
I am having an issue that if I use the auto-positioning to start my miniwindow with WindowCreate on the bottom right (miniwin.pos_bottom_right) WindowInfo 1 and 2 as well as 11 and 12 both return 0 since that was the setting for long Left and long Top even though it is clearly not on the top left of my screen but the bottom right.
This causes an issue since later I use those settings when resizing, so it jumps to the top right, is there a way to create the window so it also gets those numbers correct?
Thanks.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 08 Jun 2018 03:39 AM (UTC)

Amended on Fri 08 Jun 2018 03:47 AM (UTC) by Nick Gammon

Message
WindowInfo 10 and 11 (not 11 and 12) will return the left and top of when it was last drawn. However for that to work the window must be drawn. This is because the auto-positioning works out the location each time the window is drawn, in case you resize your main window. Example code:


win = "test_" .. GetPluginID () 
WindowCreate (win, 0, 0, 200, 200, miniwin.pos_bottom_right, 0, ColourNameToRGB("white"))  -- create window
WindowShow (win,  true)  -- show it 
Repaint ()  -- Force redraw of window
print ("Left =",  WindowInfo (win, 10), " Top =", WindowInfo (win, 11))



With the Repaint call there, I get:


Left = 1115  Top = 486


If you omit Repaint, I get 0 and 0.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Rene   (46 posts)  Bio
Date Reply #2 on Fri 08 Jun 2018 08:14 AM (UTC)
Message
Will that also work for WinInfo 1 and 2?
Thanks.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 08 Jun 2018 10:51 AM (UTC)
Message
No, because as the documentation says, it returns what you supplied to WindowCreate.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,116 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.