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

Gammon Software Solutions forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  saving windowinfo when window did not open.

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

saving windowinfo when window did not open.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Orogan   (23 posts)  [Biography] bio
Date Fri 28 May 2010 07:16 AM (UTC)  quote  ]
Message
Hello,

I have a window (MWin) when I click on a button, it changes to an other view (MiniMWin).I want to save the pos of MiniMWindow on savestate, only problem is when the MiniMWin hasn't been used yet it causes a problem.

My code:


function OnPluginSaveState ()
 	SetVariable ("TopMiniWin", WindowInfo (MiniMWin, 11))
	SetVariable ("LeftMiniWin", WindowInfo (MiniMWin, 10))
end -- OnPluginSaveState



error :

[string "Plugin"]:383: bad argument #2 to 'SetVariable' (string expected, got nil)
stack traceback:
[C]: in function 'SetVariable'
[string "Plugin"]:383: in function <[string "Plugin"]:379>

I know why it's giving the error just not how to solve it proper.
What would be the way to solve this?

Hope this makes sense.

Orogan
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 28 May 2010 08:29 PM (UTC)  quote  ]
Message
Orogan said:

Hello,

I have a window (MWin) when I click on a button, it changes to an other view (MiniMWin).I want to save the pos of MiniMWindow on savestate, only problem is when the MiniMWin hasn't been used yet it causes a problem.



Why? Why not just save the position of the original window, which should exist, rather than a button which may never exist?

- 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.


779 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]