Welcome to Purlovia’s documentation!¶
-
class
gui.tree.
Tree
(frame, columns=('type', 'value'), **kw)¶ A view based on Tkinter’s Treeview class with methods for parsing the asset tree.
Any kwargs that are passed in are passed directly to Treeview’s __init__ method
Parameters: - frame – The Tkinter Frame to render the Tree in
- columns – (Optional) A tuple of the column names to create for the tree. Default: (“type”, “value”)
- kw – (Optional) Any other kwargs to pass to Treeview’s __init__
-
add_asset_to_root
(asset: ue.base.UEBase)¶ Adds an asset to the root of the tree.
This asset is parsed into the tree which is displayed.
Parameters: asset – UEBase
The asset to add.Returns: None
-
add_placeholder_node
(item_id)¶ Add a tag to specify this node as having a placeholder (so it will raise an event when opened)
Parameters: item_id – The id of the item to create the placeholder for. Returns: None
-
static
get_node_iterator
(node)¶ Gets an iterator of the current node
Parameters: node – Union[list, UEBase]
The node to processReturns: An iterator of the node passed in. Raises: TypeError
if node is not alist
orUEBase
-
static
get_value_as_string
(value)¶ Returns a value as a string.
Parameters: value – The value to get a string representation of. Returns: - The number of entries if value is a list.
- The name of the type for any other type.
- The string representation for everything else.
-
has_children
(node)¶ Checks to see if the node passed in has any children
Parameters: node – The node to check Returns: Boolean
True if the node has children, False otherwise.
-
insert_fields_for_node
(parent_id)¶ Inserts nodes into the tree and creates a placeholder if the node has children.
Parameters: parent_id – The id of the node to insert Returns: None
-
static
node_id
(node, parent_id=None)¶ Create a string ID for a node.
Parameters: - node –
UEBase
node to get the ID of - parent_id –
str
ID of the parent node
Returns: The ID of node if it is an instance of UEBase or None otherwise.
- node –
-
on_tree_open
(evt: tkinter.EventType)¶ This is called when a node containing a placeholder is opened for the first time
Parameters: evt – Event (Not currently used) Returns: None
-
static
type_name
(value)¶ Return the type of a value as a string.
Parameters: value – The value to get the type of. Returns: A string of value’s type.