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

  • 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:assetUEBase The asset to add.

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.
static get_node_iterator(node)

Gets an iterator of the current node

Parameters:nodeUnion[list, UEBase] The node to process
Returns:An iterator of the node passed in.
Raises:TypeError if node is not a list or UEBase
static get_value_as_string(value)

Returns a value as a string.

Parameters:value – The value to get a string representation of.
  • The number of entries if value is a list.
  • The name of the type for any other type.
  • The string representation for everything else.

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.

Inserts nodes into the tree and creates a placeholder if the node has children.

Parameters:parent_id – The id of the node to insert
static node_id(node, parent_id=None)

Create a string ID for a node.

  • nodeUEBase node to get the ID of
  • parent_idstr ID of the parent node

The ID of node if it is an instance of UEBase or None otherwise.

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)
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.

Indices and tables