ui

class guerilla.ui

Bases: object

A package of functions dedicated to managing UI

static border(name, parent)

Create a Border window

Parameters:
  • name (str or number or None) – The name of the window
  • parent (Window) – The parent window
Returns:

The new border

Return type:

Border

static control(parent, plug, desc)

Create a dedicated Window that can control a Plug or a list of Plugs

Ex:

LUA{local ctrl = ui.control (myparentwindow, Document:getpreferences ().ShutterOpen, types.float {slidermin=0,slidermax=0.4})}

param parent:The parent window
type parent:Window
param plug:The Plug to connect to the created window, or the list of Plugs
type plug:Plug or {Plug}
param desc:A substitute type to be used if the Plug type is to be overriden
type desc:type
return:The new control
rtype:Window
static disableupdates()

Globally disables UI updates

static droplist(name, parent)

Create an DropList window

Parameters:
  • name (str or number or None) – The name of the DropList window
  • parent (Window) – The parent window to create in
Returns:

The new edit

Return type:

DropList

static dyntext(name, parent)

Create a static Text window

Parameters:
  • name (str or number or None) – The name of the window
  • parent (Window) – The parent window
Returns:

The new text

Return type:

Text

static edit(name, parent)

Create an Edit window

Parameters:
  • name (str or number or None) – The name of the Edit window
  • parent (Window) – The parent window to create in
Returns:

The new edit

Return type:

Edit

static editbox(name, parent)

Create an EditBox window

Parameters:
  • name (str or number or None) – The name of the EditBox window
  • parent (Window) – The parent window to create in
Returns:

The new edit box

Return type:

EditBox

static editnode(node, focus, view)

Set the ui to edit a node

Parameters:
  • node (Node) – The node to edit
  • focus (Node) – The optional child to set edit focus on
  • view (Window) – The optional view to set edit to
static enableupdates()

Globally enables UI updates

static focusview(viewtype)

Focus the first view of the given type, or create a new one in the active tab if none found

This function focuses the first view that matches the given type anywhere in the window layout.

In the event such a window can’t be found, a new window of that type is created in the current active tab. Available view types are:

  • Library
  • Linking
  • NodeList
  • Passes
  • RenderView
  • Browser
  • Viewport
param viewtype:The view type
type viewtype:str
static getactiveview()

Return the current active view (the one with the orange frame)

Returns:The current active view or None
Return type:Window
static getactiveviewpath()

Return the path to the node edited in the current active view

Returns:The path to the node edited
Return type:Window
static getrootwindows()

Return a table of all root windows

Returns:The current root windows
Return type:{Window}
static getthemepath()

Get the current theme path

Returns:The path of the current theme
Return type:types.string
static linker(name, parent, mode, invert)

Open a Linker with preselected mode

Parameters:
  • name (str or number or None) – The window name
  • parent (Window) – The parent window
  • mode (types.string or table) – The preselected linker mode, see also <a href=’Packages_linker_linker.connect.html’>linker.connect</a> for more information on custom modes
  • invert (types.bool) – Open the linker with swapped left and right classes
Returns:

The created linker window

Return type:

Window

static linkerbox(name, parent, mode, invert)

Open a Linker within a TitleWindow with preselected mode

Parameters:
  • name (str or number or None) – The window name
  • parent (Window) – The parent window
  • mode (types.string or table) – The preselected linker mode, see also <a href=’Packages_linker_linker.connect.html’>linker.connect</a> for more information on custom modes
  • invert (types.bool) – Open the linker with swapped left and right classes
Returns:

The created linker window

Return type:

Window

static loadlayout(file)

Load a window layout file, replace the current layout

Parameters:file (str) – The file path to load
static loadtheme(filename)

Load a theme file

Parameters:filename (str) – The file to load, or nil to load the current theme file
static propertybox(selection=None)

Open a property box window

Parameters:selection (table) – A list of objects to preselect
Returns:The propertybox window
Return type:Window
static quad(name, parent)

Create a Quad window

Parameters:
  • name (str or number or None) – The name of the window
  • parent (Window) – The parent window
Returns:

The new quad

Return type:

Quad

static savelayout(file)

Save the current window layout into a file

Parameters:file (str) – The file path to save
static savetheme(filename)

Save a theme file

Parameters:filename (str) – The file to save, or nil to save the current theme file
static setactiveviewpath(path)

Set the active view to edit a node

Parameters:path (str) – The path of the node to edit in the active view
static setmousebuttonhandler(windowclass, button, mod, event, handler)

Binds the provided handler to the window event

Parameters:
  • windowclass (class) – The window class to bind
  • button (str) – The button to be handled, either “left”, “middle” or “right”
  • mod (number or None) – The modifier combination to be associated to the handler, a combination of modifiers.Shift, modifiers.Control, modifiers.Alt
  • event (str) – The kind of event to bind, either “down”, “up, “drag”, “dragend” or “click”
  • handler (the) – callback function (window, x, y) to handle the event
static text(name, parent)

Create a static Text window

Parameters:
  • name (str or number or None) – The name of the window
  • parent (Window) – The parent window
Returns:

The new text

Return type:

Text

static textbutton(name, parent, text)

Create a TextButton

Parameters:
  • name (str or number or None) – The name of the EditBox window
  • parent (Window) – The parent window to create in
  • text (str) – The button label
Returns:

The new text button

Return type:

TextButton

static titlewindow(name, parent)

Create an TitleWindow. You must call the show method to make the window visible.

Parameters:
  • name (str or number or None) – The name of the TitleWindow window
  • parent (Window) – The parent window to create in
Returns:

The new title frame

Return type:

TitleWindow

static tree(name, parent)

Create an Tree

Parameters:
  • name (str or number or None) – The name of the Tree window
  • parent (Window) – The parent window to create in
Returns:

The new tree

Return type:

Tree

static treeex(name, parent)

Create a TreeEx

Parameters:
  • name (str or number or None) – The name of the Tree window
  • parent (Window) – The parent window to create in
Returns:

The new tree

Return type:

Tree

static window(name, parent)

Create a simple Window

Parameters:
  • name (str or number or None) – The name of the window
  • parent (Window) – The parent window
Returns:

The new window

Return type:

Window