Classes | GUI > EZ-GUI

EZGui : Object

An abstract superclass for EZ widget wrappers
Source: EZgui.sc


Users will not normally directly create instances of EZGui, but only use it through its subclasses. It provides the basic mechanisms for various EZ widget wrappers. It also provides a standard for EZ GUI Classes, and new EZ Classes should subclass EZGUI to help keep a consistent user interface.

Class Methods

Inherited class methods

Instance Methods

Accessing Instance Variables


Returns the enclosing CompositeView.


Returns the bounds of the enclosing CompositeView.


Sets/gets it the label. Will add the label view if none was initially created.



An Instance of String.


Returns the window if you used the popUp window function.

Accessing GUI options


.alwaysOnTop = bool

Makes the popup window always on top, if there is one.



An Instance of Boolean. Default is false.


.visible = bool

Sets/gets it the component views are visible.



An Instance of Boolean. Default is true.


.enabled = bool

Sets/gets if the list is enabled.



An Instance of Boolean. Default is true.


.onClose = func

Sets/gets the onClose function of either view or window, depending on whether the EZ view used a popup window.



An Instance of Function or FunctionList.

.font = font



An instance of Font.


EZGui provides a standard and basic tools for most EZ classes. If you make a new EZ class, then subclass EZGui, and override the necessary methods. If your class only has a label and a widget, chances are, you need to override nothing, but only need to write the new and init class methods. See existing subclasses of EZGui for examples of this. You may also want to override the following:


Returns the active widget. Subclasses will typically refer to it or ignore it, e.g.:


.action = value

Gets/sets the action of the EZ class instance.



An Instance of Function or FunctionList.


.value = val

Gets/sets the value of the widget. Does not perform the action.



An integer.

.valueAction = val

Gets/sets the value of the widget. Performs do action.



An integer.


Performs this.action.value(this).

Internal Utilities

.prSubViewBounds(rect, hasLabel)

This calculates the bounds of the subviews and the gaps. It returns an array of Rects, which depends on how many subview there are. Subclasses override this if they have more than one widget.

.prMakeView(parentView, bounds)

Called by init. Returns [view, bounds]. The container is either the enclosing Container, or a pop up window with a container.


Only defined by some subclasses. Sets the resize and align of all the views, according to the state of layout.

.prMakeMarginGap(parentView, argMargin, argGap)

Called in the init method of all subclasses. Sets the margin and gap of view. By default, it tries to get its parent's gap, otherwise it defaults to 2@2. Setting argGap overrides these.

Inherited instance methods

Undocumented instance methods


.labelView = value



.valueActionIfChanged = val

From extension in /SuperCollider/Contents/Resources/SCClassLibrary/Common/GUI/Base/extValueActionIfChanged.sc