

If the first arg is a string, it is treated as the name of the variable. *units_on_flag: off in the nrn/lib/nrn.defaults file. The units display may be turned off with h.units(0) or by setting the Variables must be given units before retrieving a session that shows them Note that units are NOT saved in a session. L, diam, Ra, t, etc are built-in and units for membrane mechanism variablesĪre declared in the model description file. String (if it exists) along with the normal prompt string. When units are on (default on) value editor buttons display the units map () print ( 'can read/change length.val, diam.val' ) intercept ( True ) length = ValuePanel ( label = 'length.val' ) diam = ValuePanel ( init_val = 2, label = 'diam.val', lower_limit = 0, upper_limit = 5 ) hbox. _upper_limit ) if _name_ = "_main_" : hbox = h. setter def val ( self, new_val ): new_val = max ( self. xpanel () def _bounds_check ( self ): self. When the menu title button is selected, the stmt is executed in a contextįrom neuron import h, gui class ValuePanel : def _init_ ( self, init_val = 42, label = '', lower_limit = 0, upper_limit = 100 ): self. NEURONMainMenu/File/RecentDir and an example of the last type is the

xpanel () h.xmenu("title", py_callable) and h.xmenu("title", py_callable, 1)ĭynamic menu added as item in panel or menu or (when third argument xbutton ( "eight", ( item_selected, 8 )) h. xbutton ( "seven", ( item_selected, 7 )) h. xbutton ( "six", ( item_selected, 6 )) h. xbutton ( "five", ( item_selected, 5 )) h. xbutton ( "four", ( item_selected, 4 )) h. xbutton ( "three", ( item_selected, 3 )) h.

xbutton ( "two", ( item_selected, 2 )) h. xbutton ( "one", ( item_selected, 1 )) h. From neuron import h, gui import sys def item_selected ( n ): print ( 'selected value %g ' % n ) h.
