SectionBrowser
accept_action · select · select_action

SectionBrowser

class SectionBrowser
Syntax:

sb = h.SectionBrowser()

sb = h.SectionBrowser(SectionList)

Description:
Class that makes a visible list of all section names. If the optional SectionList arg is present then only those section names are shown in the browser.

Example:

from neuron import h, gui
soma = h.Section(name='soma')
sl = h.SectionList()
sl.append()
sb = h.SectionBrowser(sl)
../../_images/secbrows-sectionList.png

See also

SectionList, Shape


SectionBrowser.select()
Syntax:
.select()
Description:
currently accessed section is highlighted.

Example:

from neuron import h, gui
soma = h.Section(name='soma')
axon = h.Section(name='axon')

sb = h.SectionBrowser()
sb.select()
../../_images/secbrows-select.png

SectionBrowser.select_action()
Syntax:
sb.select_action(python_func)
Description:
A Python function is executed when an item is selected (single click or dragging) by the mouse. Before execution, the selected section is pushed. (and popped after the function completes.) A Python function is executed in the object context in which select_action registered it.

Example:

from neuron import h, gui
soma = h.Section(name='soma')
axon = h.Section(name='axon')

def select(sec):
    print 'select:', sec, type(sec)

def accept(sec):
    print 'accept:', sec

sb = h.SectionBrowser()
sb.select_action(select)
sb.accept_action(select)

Note

Python support for select_action() was added in NEURON 7.5.


SectionBrowser.accept_action()
Syntax:
sb.accept_action(python_func)
Description:
A Python function is executed when an item is accepted (double click) by the mouse. Before execution, the selected section is pushed. (and popped after the function completes.) A Python function is executed in the object context in which the accept_action registered it.

Example:

from neuron import h, gui
soma = h.Section(name='soma')
axon = h.Section(name='axon')

def select(sec):
    print 'select:', sec, type(sec)

def accept(sec):
    print 'accept:', sec

sb = h.SectionBrowser()
sb.select_action(select)
sb.accept_action(accept)

Note

Python support for accept_action() was added in NEURON 7.5.