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

EnvirGui

display the contents of an environment for editing
Location: NOT INSTALLED!

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

.new

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

how many envir items to display

.envir

the envir displayed - actually an alias for object.

.zone

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

set the environment to show

Arguments:

obj

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

.envir

same as object_(obj)

.name

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

.getSpec

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

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

add a key to replace and its replacer key

.removeReplaceKey

remove a replacer key

.showKeyFor

show

.highlight

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

.unhighlight

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

Some internal methods

.setByKeys

update the widgets for the current keys

.showFields

show (num) active fields, make others invisible.

.useRanger

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

methods that make gui elements:

.makeViews

.makeOptionalViews

the method that makes all views specified in the options

.makeNameView

.makeKnowBut

.makeDocBut

.makeClrBut

.makeProtoBut

.makeParentBut

the methods that make the individual elements as specified

standard JITGui methods:

.accepts

.setDefaults

.getState

.checkUpdate

.updateButtons

Inherited instance methods

Examples