This GUI Toolkit provides classes to create simple GUIs for ReaScripts using native gfx code in Lua. UIs are built by constructing parent-child trees using the toolkit classes.
Reaper v7.76+
The GUIToolkit.lua file must be in the same location as any Reascript that wants to use it.
Below is a simple example of a GUI that positions two button that when pressed change some text.
NOTE: Using gfx.w or gfx.h for the width and height parameters of a UI element constructor means the UI element will expand to fit the entire window or constraints of the parent element, if any. If given literal values, the element will size to the minimum of either the given values or the constraints of the parent.
The GUIContext is the first class that should be instantiated. It manages the root of the UI tree, an input handler, and is responsible for constantly updating the UI through the tree.
The base class upon which all other UI elements are built. Instantiating this class creates a UI element that allows child elements to control their own xy-position. These functions can be used on any UI element.
This UI element distribute immediate child elements horizontally within the container's runtime width. This container takes into consideration child element ratio values.
This UI element will distribute immediate child elements horizontally within the container's runtime height. This container takes into consideration child element ratio values.
This UI element will scale immediate child elements to fit the runtime size of the container. It is meant to only hold one immediate child element.
This UI element will distribute immediate child elements vertically using their declared height. If the combined height of the UI elments is larger than the viewable area of the container, the container can be scrolled.
This UI element creates an exclusive tab for each immediate child element. Tab selections uses the runtime width of the container and is not scrollable. Tab names use the string id of the UI element by default when the child element is initially added.
This UI element only displays text.
This UI element can either be a click or toggle button.
This UI element holds a modifiable text value.
This UI element holds a modifiable numeric value.
This UI element creates a dropdown list of named options.
This UI element creates a scrollable list of named items. It supports single selection and multiselection.
This UI element can toggle showing and hiding its immedite child elements.