View Single Post
03/18/20, 07:22 PM   #16
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
The handlers in the XML are atatched to the controls you create in the XML so they will be fired after the controls were created.

Normally this should also happen if the xml is loaded before the lua file was loaded.
As long as the events of the xml control is not refrencing any lua code which is in a file that get's loaded after the xml, everything should be fine.
Like OnInitialized will fire as the control get's created -> lua code therefore must exist before xml creation.
But e.g. OnMouseDown could be even in another lua file loaded after the xml as the mouse click will most likely not happen automatically as the control get's created

OnMoveStopped also should only be fired if the control get's moved (manually or via lua code maybe). Never tested this if it fires as you somehow use the lua functions to move (reanchor) the control.
e.g. if in your lua file the event_add_on_loaded will load the SavedVariables and then reset the xml control to a saved position. Not sure if this will also trigger the OnMoveStop event then.

Last edited by Baertram : 03/18/20 at 07:25 PM.
  Reply With Quote