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 ➜ Bug reports ➜ GetInfo size fields at startup

GetInfo size fields at startup

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


Posted by Fiendish   USA  (2,551 posts)  Bio   Global Moderator
Date Mon 04 Jul 2011 05:33 AM (UTC)

Amended on Mon 04 Jul 2011 05:34 AM (UTC) by Fiendish

Message
If I do print(GetInfo(250),GetInfo(281)) in OnPluginInstall in a plugin that gets loaded in a world that loads at client start, I get "1278 817"

If I do it a second later with DoAfterSpecial, I get "1278 1258"

Why is GetInfo(281) not reliable right at startup like 250 seems to be?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 04 Jul 2011 07:54 AM (UTC)
Message
There are various race conditions that are likely to occur during startup. For example the world window might resize as various directives are read, such as font size, whether automatic resizing is in force, and then it reads the current world window dimensions from the .ini file.

It might be better to do things like getting the window size during the OnPluginListChanged callback. Possibly also the OnPluginWorldOutputResized callback might help.

I don't have the source to hand right now (apart from Git of course) so I can't totally confirm which would be best.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,169 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 04 Jul 2011 08:41 PM (UTC)
Message
I think that is recalled in response to a WM_SIZE windows message, and they seem to arrive at all sorts of odd times. For example, before the window fully exists. And possibly under Wine you may get different results again.

- Nick Gammon

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

Posted by Fiendish   USA  (2,551 posts)  Bio   Global Moderator
Date Reply #3 on Mon 04 Jul 2011 08:50 PM (UTC)
Message
Sorry, I guess I ninjaed you :\

https://github.com/fiendish/aardwolfclientpackage
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.


11,547 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.