Window¶
-
class
guerilla.Window¶ Bases:
objectBase class of all the document’s nodes.
-
addtracker(tracker)¶ Add a tracker to this window. A tracker receives notification when the tracked window is invalidated or destroyed. A tracker may implement onTrackedDestroyed and onTrackedInvalidated to get notifications on such events
Parameters: tracker (table) – The tracker that listens to notifications.
-
destroy()¶ Destroy the window and all its children windows
-
disable()¶ Disable the window
-
enable()¶ Enable the window
-
getchild(name)¶ Get a child window
Parameters: name (str or number) – The child window name
-
geth()¶ Get the window height
-
getparent(parentclass)¶ Get the first parent window of given class (immediate parent if no class is provided)
Parameters: parentclass (str or None) – An optionnal parent class
-
getroot()¶ Return the root window of this window
-
getw()¶ Get the window width
-
getx()¶ Get the window X coordinate in the parent space
-
gety()¶ Get the window Y coordinate in the parent space
-
hasAttr(name, type)¶ Check whether a child node or plug of given type exists
Parameters:
-
hasChild(name)¶ Check whether a child exists or not
Parameters: name (str) – child name Returns: True if child exists else False Return type: bool
-
hasPlug(name)¶ Check whether a plug exists or not
Parameters: name (str) – plug name Returns: True if plug exists else False Return type: bool
-
hide()¶ Hide the window
-
plugs()¶ Iterator over all plugs in Node
Return type: iterator
-
removetracker(tracker)¶ Remove a tracker of this window.
Parameters: tracker (table) – The tracker to remove.
-
setcolor(color)¶ Change the window color, see also ui.color function
Parameters: color (ui.color) – the color to set
-
setfocus()¶ Set the focus to the window
-
seth(h, parentmul, childadd, childmul)¶ Set the window height
Parameters: - h (number) – The absolute height of the window
- parentmul (number) – The parent window height factor
- childadd (number) – The height added to the heighest child
- childmul (number) – The heighest child height factor
-
settopmost()¶ Set the window as top most in children order
-
setw(w, parentmul, childadd, childmul)¶ Set the window width
Parameters: - w (number) – The absolute width of the window
- parentmul (number) – The parent window width factor
- childadd (number) – The width added to the largest child
- childmul (number) – The largest child width factor
-
setx(x, parentpivot, pivot)¶ Set the X window placement
Parameters: - x (number) – The x coordinate of the window in pixels, relative to the parent
- parentpivot (number) – The pivot position in parent window, in 0..1 range
- pivot (number) – The pivot position in window, in 0..1 range
-
sety(y, parentpivot, pivot)¶ Set the Y window placement
Parameters: - y (number) – The y coordinate of the window in pixels, relative to the parent
- parentpivot (number) – The pivot position in parent window, in 0..1 range
- pivot (number) – The pivot position in window, in 0..1 range
-
show()¶ Show the window
-