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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Miniwindow Resetting to Upper Left

Miniwindow Resetting to Upper Left

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


Posted by Mvineyard   (2 posts)  [Biography] bio
Date Mon 14 Apr 2014 05:27 AM (UTC)

Amended on Mon 14 Apr 2014 05:30 AM (UTC) by Mvineyard

Message
Can someone help me understand why my mini window keeps resetting? As you can see, I am tracking the windowinfo.window_left and windowinfo.window_top which do give me back correct coordinates but when 'updatewindow' runs it simply resets to 0,0. Am I missing a save window state somewhere?



function OnPluginInstall ()
 win = GetPluginID () .. "_doit"
 windowinfo = movewindow.install (win, miniwin.pos_top_right)
 updatewindow ()
end -- OnPluginInstall

function OnPluginSaveState ()
  movewindow.save_state (win)
end -- function OnPluginSaveState

function updatewindow ()
  if scur > 0 then
   winheight = 25 + (scur * 15)
  else
   winheight = 50
  end
  WindowCreate (win, tonumber(windowinfo.window_left), tonumber(windowinfo.window_top), 225, winheight, 0, 0, ColourNameToRGB ("#EFDFCF")) 
  WindowGradient (win, 0, 0, 0, 0, ColourNameToRGB ("#2F2F4F"), ColourNameToRGB ("black"), miniwin.gradient_vertical)
  WindowFont (win, "f", "Trebuchet MS", 8, true, false, false, false)
  WindowText (win, "f", "Doit: Command Stack", 5, 5, 0, 0, ColourNameToRGB  "dodgerblue")
  WindowText (win, "f", windowinfo.window_left, 165, 5, 0, 0, ColourNameToRGB  "dodgerblue")
  WindowText (win, "f", windowinfo.window_top, 200, 5, 0, 0, ColourNameToRGB  "dodgerblue")

  NOTE: Program bits, 4 calls to windowtext in this portion

  movewindow.add_drag_handler (win, 0, 0, 0, 15)
  WindowShow (win, true)
end
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 14 Apr 2014 06:37 AM (UTC)
Message
Hard to say without seeing the plugin, but is it set to save states?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Mvineyard   (2 posts)  [Biography] bio
Date Reply #2 on Tue 15 Apr 2014 05:48 AM (UTC)
Message
I do have this in the plugin initiation 'save_state="y"' if that is what you are referring to.

What happens is if I reinstall the plugin the window temporarily shows at 0,0 for about two seconds and then it will move to the location where it last was (good, but its' very sluggish). However, when the plugin is running and the function 'updatewindow()' is called which creates the window again it moves back to 0,0 and stays there. The windowinfo gives the correct coordinates though.

The rest of the program contains triggers which don't actually change any window components. What you're looking at is a stack so when update window is called I've added or removed something from it.
[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.


8,534 views.

It is now over 60 days since the last post. This thread is closed.     [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 HostDash]