[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Miniwindows Position
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Miniwindows Position

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page


Posted by Rene   (37 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] 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
[Go to top] top

Posted by Rene   (37 posts)  [Biography] bio
Date Reply #2 on Fri 08 Jun 2018 08:14 AM (UTC)
Message
Will that also work for WinInfo 1 and 2?
Thanks.
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] 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
[Go to top] 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.


185 views.

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]