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 ➜ Miniwindows ➜ The Mushclient can't draw MiniWindow.

The Mushclient can't draw MiniWindow.

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


Posted by Killunix   (12 posts)  Bio
Date Sun 05 Sep 2010 06:24 AM (UTC)
Message
I use the following code to drawing a window in mushclient,the version 4.43 show the window correct.all the upper version include 4.60 show nothing. I use the Immediate to test this. Is it has any other settings for drawing this? Thanks!

win = GetPluginID () -- get a unique name
WindowCreate (win, 0, 0, 200, 200, 12, 0, ColourNameToRGB("white")) -- create window
WindowShow (win, true) -- show it
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 05 Sep 2010 06:34 AM (UTC)
Message
See the release notes for version 4.46. In that there was a change to miniwindow creation:

http://www.gammon.com.au/scripts/showrelnote.php?version=4.46&productid=0


2. WindowCreate now returns two error messages:

eNoNameSpecified - a zero-length string was supplied as the window name
eBadParameter - the width or height of the window may not be negative


In your case you could check with the "check" function like this:


win = GetPluginID () -- get a unique name
check (WindowCreate (win, 0, 0, 200, 200, 12, 0, ColourNameToRGB("white"))) -- create window
WindowShow (win, true) -- show it 


When I do that I get the message:

Run-time error
World: SmaugFUSS
Immediate execution
[string "Immediate"]:2: No name has been specified where one is required
stack traceback:
        [C]: in function 'error'
        [string "Check function"]:1: in function 'check'
        [string "Immediate"]:2: in main chunk


Your code would have worked in a plugin but in the immediate window GetPluginID () returns an empty string.

You can add something, eg.


win = GetPluginID () .. "main_window"


That works in a plugin and also in the Immediate window.

- Nick Gammon

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

Posted by Killunix   (12 posts)  Bio
Date Reply #2 on Sun 05 Sep 2010 06:49 AM (UTC)
Message
Thanks, Now I can use the new version!
thanks
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,670 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.