API:WindowSetParent
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Moves a window under a different parent window.
WindowSetParent(windowName, parentName)
Arguments
- windowName
string– Name of the window to move.- parentName
string– Name of the new parent. Use"Root"to make it a top-level window.
Returns
Nothing.
Details
- The window is removed from its old parent's child list and added to the new parent's.
- The window's depth becomes the new parent's depth plus one.
- The window's anchors are not changed. Anchors that point at the old parent keep pointing at it, so re-anchor the window if it should follow the new parent.
- There is no check for loops. Making a window the parent of one of its own ancestors is not refused.
- The root window cannot be given a parent.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'WindowSetParent': Window %s does not existError in function call 'WindowSetParent': Parent Window %s does not existError in function call 'WindowSetParent': The parent of the root window cannot be changed.Error in function call 'WindowSetParent': Window %s is currently locked and may not be modified from lua. ...
This check never triggers in the current client. See WindowSetShowing.
Example
Detaching context-menu items so they draw above other windows, from ea_contextmenu/source/contextmenu.lua:
WindowSetParent( menuItemName, "Root" )
Moving a chat tab into another tab group, from ea_chatwindow/source/chatwindow.lua:
WindowSetParent( tabWndName, tabParent ) WindowSetParent( tabLogDisplayName, EA_ChatWindowGroups[newWndGroupId].name )
