EnvirGui:
Filter:
Classes | JITLib > GUI | Live Coding

EnvirGui : JITGui : Object

display the contents of an environment for editing
Source: EnvirGui.sc
Subclasses: NdefParamGui

Description

EnvirGui displays all keys and values of an environment, so one can change them flexibly. Single number get displayed with an EZSlider, pairs of numbers with an EZRanger, and anything else is shown as an EZText (a text field).

Class Methods

Creation

EnvirGui.new(object, numItems: 8, parent, bounds, makeSkip: true, options: [ ])

create a new EnvirGui NdefParamGui

Arguments:

object

the envir to display

numItems

the number of items to display. If an envir is given, and no num, num is envir.size.

parent

the parent view to display in; if none is given, a new window is created.

bounds

the bounds within which to display; if none is given, bounds are calculated.

makeSkip

flag whether to make a skipjack to manage updates of the envirgui.

options

configuration options

Inherited class methods

Instance Methods

Instance Variables

.numItems

From superclass: JITGui

how many envir items to display

.envir

.envir = envir

the envir displayed - actually an alias for object.

.zone

From superclass: JITGui

the composite view the envirgui makes for itself

.paramViews

the paramViews that display the values:

See ParamView for details.

.specs

a local dictionary of the specs used for display ranges of numerical parameters by the paramViews of this envirgui. See the -getSpec method for details.

.editKeys

the keys of the currently displayed items in the dict.

.keysRotation

if the size of envir exceeds numItems, the keys displayed can be rotated: e.g. with 10 keys displayed on 5 paramViews, keysRotation 0 means show keys (0..4), keysRotation 2 means show keys (2..6), etc.

gui elements present if requested in options

.docBut

.knowBut

.parentBut

.protoBut

Some Methods

.object

.object = obj

From superclass: JITGui

set the environment to show

Arguments:

obj

can be nil, a dictionary, an environment, or an event.

.envir

.envir = envir

same as object_(obj)

.name = name

if in its own window, set the window's name

.getSpec(key, value)

For editing, numerical parameters need control specs for the ranges on the gui. These can be set locally in the EnvirGui, or global specs will be looked up. If no local or global specs exist for that parameter name, getSpec makes a usable guess for them. (With JITLibExtensions, one can also look up specs attached to an object such as a proxy.)

Arguments:

key

the parameter name for which to find a spec

value

the current value of that param, which is used when guessing specs.

.putSpec(key, obj)

add a spec for a given key, or (if it is a global key) override a global spec with a local one:

Keys with technical names can be replaced in the display with clearer names: method replaceKeys the current list of keys to replace

.addReplaceKey(replaced, replacer, spec)

add a key to replace and its replacer key

.removeReplaceKey(replacer)

remove a replacer key

.showKeyFor(key)

show

.highlight(index, prefix, color)

highlight the paramview at a given index, by color and optional prefix

.unhighlight(index)

remove highlighting at an index g.unhighlight(0);

Some internal methods

.setByKeys(newKeys)

update the widgets for the current keys

.showFields(num: 0)

show (num) active fields, make others invisible.

.useRanger

.useRanger = value

set and get whether arrays of 2 number values should be displayed with EZRangers.

methods that make gui elements:

.makeViews(options)

.makeOptionalViews(options, height: 20)

the method that makes all views specified in the options

.makeNameView(width, height)

.makeKnowBut(width, height)

.makeDocBut(width, height)

.makeClrBut(width, height)

.makeProtoBut(width, height)

.makeParentBut(width, height)

the methods that make the individual elements as specified

standard JITGui methods:

.accepts(obj)

.setDefaults

.getState

.checkUpdate

.updateButtons

Inherited instance methods

Undocumented instance methods

.colorizeArea(area, hilite: true)

.replaceKeys

.setFunc(key)

Examples