GUI:
Filter:
Classes | GUI > Kits

GUI : Object

Factory abstraction for all GUI related core classes
Source: GUI.sc

Description

SuperCollider currently supports three operating system platforms: macOS, UNIX (Linux and FreeBSD) and Windows (with some limitations).

WARNING: The redirect system has been deprecated, please use the view classes directly. If you find old code that uses prefixes for the old GUI Kits (e.g. SCWindow for CocoaGUI, JSCWindow for SwingOSC), try dropping the prefixes to Window, Button etc. The Qt prefix Q, as e.g. in QWindow, is converted to Window automatically; still it is better style to simply write Window.

Switching between GUI schemes is not needed anymore, as Qt runs well on all platforms. Still, you can get the available schemes with:

For a complete list of historical gui classes and their redirects, see List of GUI classes.

Class Methods

GUI.new(key)

GUI.makeGUI(key, args, properties)

GUI.initClass

Sets the skin to default values on compile.

GUI.add(aScheme)

GUI.qt

Makes QtGUI the current scheme and returns it. Subsequent GUI object calls to GUI are delegated to Qt. Returns the current (Qt) scheme.

GUI.swing

If SwingOSC is installed, makes SwingGUI (Java GUI) the current scheme and returns it. Subsequent GUI object calls to GUI are delegated to swing. Returns the current (swing) scheme.

GUI.fromID(id)

Changes the current scheme and returns the new scheme.

Arguments:

id

A Symbol. The identifier of the scheme to use.

GUI.current

Returns the current scheme. This is useful for objects that, upon instantiation, wish to store the then-current scheme, so as to be able to consistently use the same scheme in future method calls.

NOTE: the caller shouldn't make any assumptions about the nature (the class) of the returned object, so that the actual implementation (an Event) may change in the future.

GUI.get(id)

Returns the scheme for a given identifier. Does not switch the current scheme.

Arguments:

id

A Symbol. The identifier of the scheme to retrieve, such as returned by calling aScheme.id.

GUI.set(aScheme)

Changes the current scheme.

Arguments:

aScheme

An instance of Symbol. The scheme to use as current scheme.

GUI.use(aScheme, func)

Executes a function body, temporarily setting the current GUI scheme. This is useful inside view's action functions in order to make this function use the GUI scheme that was originally used for the view of the action, even if the scheme has been switched meanwhile.

Arguments:

aScheme

The scheme to use during the function execution.

func

An Instance of Function.

GUI.useID(id, func)

Same as use but using a scheme's id as first argument.

Arguments:

id

The id of the scheme to use during the function execution.

func

A body to execute.

GUI.add(aScheme)

Registers a new scheme. This is typically called by external libraries in their startup procedure. If a scheme with the same identifier (scheme.id) exists, it is overwritten.

Arguments:

aScheme

The scheme to add.

GUI.doesNotUnderstand(selector ... args)

All method calls are mapped to the current scheme, so that for example GUI.button can be used and is delegated to the button association of the current scheme.

Arguments:

selector
... args

GUI.setSkin(skinName)

Arguments:

skinName

GUI.scheme

A class variable. Returns the current scheme.

GUI.schemes

A class variable. Returns an IdentityDictionary of registered schemes.

GUI.skin

A class variable. Returns the current skin.

GUI.skins

A class variable. Returns an IdentityDictionary of registered skins.

Inherited class methods

Instance Methods

Inherited instance methods