general
xbutton xlabel xpvalue xstatebutton
xcheckbox xmenu xradiobutton xvalue
xfixedvalue xpanel xslider xvarlabel
The following are implemented as hoc functions. They are used to create
panels of buttons, menus, and field editors.
button-menu-panel
SYNTAX
xpanel("name")
xpanel("name", [0-1])
xpanel()
xpanel(x, y)
DESCRIPTION
-
xpanel("name")
-
xpanel("name", [0-1])
- Title of a new panel. Every
button, menu, and value between this and a closing
xpanel()
command
with no arguments (or placement args) belongs to this panel.
If the form is used with a second argument equal to 1, then
the panel is laid out horizontally. Otherwise the default is vertically.
-
xpanel()
-
xpanel(x, y)
- done constructing the panel. so map it to the screen with position
optionally specified.
button-menu-panel
SYNTAX
xbutton("command")
xbutton("prompt", "command")
DESCRIPTION
-
xbutton("command")
- new button with command to execute when pressed. The label
on the button is "command".
-
xbutton("prompt", "command")
- the label ont the button is "prompt", the action
to execute is "command".
button-menu-panel
SYNTAX
xstatebutton("prompt",&var [,"action"])
DESCRIPTION
like xbutton, but when pressed var is set to 0 or 1 so that it matches the
telltale state of the button. If the var is set by another way the
telltale state is updated to reflect the correct value.
button-menu-panel
SYNTAX
xcheckbox("prompt",&var [,"action"])
DESCRIPTION
like xstatebutton, but checkbox appearance.
button-menu-panel
SYNTAX
xradiobutton(...)
DESCRIPTION
Like an xbutton
but highlights the most recently selected
button of a contiguous group (like a car radio, mutually exclusive
selection).
EXAMPLES
execute following example
proc a() {
print $1
}
strdef label, cmd
xpanel("panel")
xmenu("menu")
for i =1, 10 {
sprint(label, "item %d", i)
sprint(cmd, "a(%d)", i)
xradiobutton(label, cmd)
}
xmenu()
xpanel()
button-menu-panel
SYNTAX
xmenu("title")
xmenu()
DESCRIPTION
-
xmenu("title")
- create a button in the panel with label "title" which, when
pressed, pops up a menu containing buttons and other menus. Every
xbutton
and xmenu
command between this and the closing xmenu()
command with no arguments becomes the menu.
Don't put values into menus.
-
xmenu()
- done defining the menu. Menus can be nested as in
xmenu("one")
xmenu("two")
xmenu()
xmenu()
button-menu-panel
SYNTAX
xlabel("string")
DESCRIPTION
Show the string as a fixed label.
button-menu-panel
SYNTAX
xvarlabel(strdef)
DESCRIPTION
Show the string as its current value.
button-menu-panel
SYNTAX
xvalue("variable")
xvalue("prompt", "variable" [, boolean_deflt, "action" [, boolean_canrun, boolean_usepointer]])
xvalue("prompt", "variable", 2)
DESCRIPTION
-
xvalue("variable")
- create field editor for variable
-
xvalue("prompt", "variable" [, boolean_deflt, "action" [, boolean_canrun, boolean_usepointer]])
- create field editor for variable with the button labeled with "prompt".
If boolean_deflt == 1 then add a checkbox which is checked when the
value of the field editor is different that when the editor was
created. Execute "action" when user enters a new value. If
boolean_canrun == 1 then use a default_button widget kit appearance
instead of a push_button widget kit appearance.
If boolean_usepointer is true then (for efficiency sake) try to
use the address of variable instead of interpreting it all the time.
At this time you must use the address form if the button is created
within an object, otherwise when the button is pressed, the symbol
name won't be parsed within the context of the object but at the
top-level context.
-
xvalue("prompt", "variable", 2)
- a field editor that keeps getting updated every 10th
doNotify()
.
The domain of values that can be entered by the user into a field editor
may be limited to the domain specified by the
variable_domain function , the domain specified for the variable in
a model description file, or a default domain that exists
for some special NEURON variables such as diam, Ra, L, etc.
For a field editor to check the domain, domain limits must be in effect
prior to creation of the field editor.
button-menu-panel
SYNTAX
xpvalue("variable")
xpvalue("prompt", &variable, ...)
DESCRIPTION
like xvalue but definitely uses address of the variable.
button-menu-panel
SYNTAX
xfixedvalue("variable")
xfixedvalue("prompt", "variable", boolean_deflt, boolean_usepointer)
DESCRIPTION
like xvalue but cannot be changed by the user except under
program control and there can be no action associated with it.
Note: this is not implemented. For now, try to do the same thing
with xvarlabel()
.
button-menu-panel
SYNTAX
xslider(&var, [low, high], ["send_cmd"], [vert], [slow])
DESCRIPTION
Slider which is attached to the variable var. Whenever the slider
is moved, the optional send_cmd is executed. The default range is
0 to 100. Steppers increase or decrease the value by 1/10 of the range.
Resolution is .01 of the range. vert=1 makes a vertical slider and
if there is no send_cmd may be the 4th arg. slow=1 removes the "repeat
key" functionality from the slider(and arrow steppers) and also
prevents recursive calls to the send_cmd. This is necessary if
a slider action is longer than the timeout delay. Otherwise the
slider can get in a state that appears to be an infinite loop.
The downside of slow=1 is that the var may not get the last value
of the slider if one releases the button during an action.
neuron/general/function/panel.hel : Dec 19 1996