general xbutton xlabel xpvalue xstatebutton xcheckbox xmenu xradiobutton xvalue xfixedvalue xpanel xslider xvarlabelThe following are implemented as hoc functions. They are used to create panels of buttons, menus, and field editors.
button-menu-panel
xpanel("name")
xpanel("name", [0-1])
xpanel()
xpanel(x, y)
xpanel("name")
xpanel("name", [0-1])
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)
button-menu-panel
xbutton("command")
xbutton("prompt", "command")
xbutton("command")
xbutton("prompt", "command")
button-menu-panel
xstatebutton("prompt",&var [,"action"])
button-menu-panel
xcheckbox("prompt",&var [,"action"])
button-menu-panel
xradiobutton("name", "action")
xradiobutton("name", "action", 0or1)
xbutton
but highlights the most recently selected
button of a contiguous group (like a car radio, mutually exclusive
selection).
If the third argument is 1, then the button will be selected when the
panel is mapped onto the screen. However, in
this case the action should also be explicitly executed by the programmer.
That is not done automatically since it is often the case that the action
is invalid when the radio button is created.
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
xmenu("title")
xmenu()
xmenu("title", 1)
xmenu("title", "stmt")
xmenu("title", "stmt", 1)
xmenu("title")
xbutton
and xmenu
command between this and the closing xmenu()
command with no arguments becomes the menu.
Don't put values into menus.
xmenu()
xmenu("one") xmenu("two") xmenu() xmenu()
xmenu("title", 1)
xpanel("menubar") xmenu("first") xbutton("one","print 1") xbutton("two","print 2") xmenu() xmenu("second", 1) xbutton("three","print 3") xbutton("four","print 4") xmenu("submenu") xbutton("PI", "print PI") xmenu() xmenu() xmenu("third", 1) xbutton("five","print 5") xbutton("six","print 6") xmenu() xmenu("nextline") xbutton("seven","print 7") xbutton("eight","print 8") xmenu() xpanel()
xmenu("title", "stmt")
and xmenu("title", "stmt", 1)
When the menu title button is selected, the stmt is executed in a context like:
which should normally build a menu list and then this list is mapped to the screen as a normal walking menu.xmenu("title") stmt xmenu()
load_file("nrngui.hoc") xpanel("test") xmenu("dynamic", "make()") xpanel() strdef s1, s2 n = 0 proc make() {local i n += 1 for i=1, n { sprint(s1, "label %d", i) sprint(s2, "print %d", i) xbutton(s1, s2) } }
button-menu-panel
xlabel("string")
button-menu-panel
xvarlabel(strdef)
button-menu-panel
xvalue("variable")
xvalue("prompt", "variable" [, boolean_deflt, "action" [, boolean_canrun, boolean_usepointer]])
xvalue("prompt", "variable", 2)
xvalue("variable")
xvalue("prompt", "variable" [, boolean_deflt, "action" [, boolean_canrun, boolean_usepointer]])
xvalue("prompt", "variable", 2)
doNotify()
.
button-menu-panel
xpvalue("variable")
xpvalue("prompt", &variable, ...)
button-menu-panel
xfixedvalue("variable")
xfixedvalue("prompt", "variable", boolean_deflt, boolean_usepointer)
xvarlabel()
.
button-menu-panel
xslider(&var, [low, high], ["send_cmd"], [vert], [slow])