dragmove is nil

Posted by Whininguser on Thu 05 Dec 2013 03:16 PM — 3 posts, 15,632 views.

Canada #0
Edit:
The problem was gone after I put the code in a plugin (which contained nothing else), but I'd love to know why the code below would generate error messages when executed from a script file.

---

Here's my entire code for a basic miniwindow. It's not part of any plugin. Just some test code in my script file.

require "movewindow"

win = "w1"

WindowCreate(win, 1, 1, 500, 350, 0, 0, ColourNameToRGB("black"))

windowinfo = movewindow.install (win, miniwin.pos_top_right, miniwin.create_absolute_location, false, nil, {mouseup=MouseUp, mousedown=LeftClickOnly, dragmove=LeftClickOnly, dragrelease=LeftClickOnly},{x=1, y=1})

movewindow.add_drag_handler(win, 0, 0, 0, 0)			   

WindowShow(win, true)



If you drag this window while receiving any data from the mud, you'd get the following message in a popup window:

Cannot find the function
'mw_w1_movewindow_info.dragmove' - item 'dragmove' is nil

When you click "OK", the popup would come up again right away until you stop getting data from the mud.

I'm using the mush package on aard's homepage.

Any ideas on how to fix this? Thanks!
Amended on Thu 05 Dec 2013 06:31 PM by Whininguser
Australia Forum Administrator #1
According to the original post about it, it is designed to work inside plugins:

http://www.gammon.com.au/forum/bbshowpost.php?id=9594

I'm not sure the exact reason why yours isn't working, I haven't worked on that for a while, but some stuff was intended to be only for plugins.
Canada #2
I see. Thanks!