GUI RunControl panel and Window size

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc.
Post Reply
ziemek
Posts: 16
Joined: Thu May 23, 2019 8:02 am
Location: Warsaw, Poland
Contact:

GUI RunControl panel and Window size

Post by ziemek » Tue Dec 03, 2019 5:34 am

I have 2 questions:
  • How can I start RunControl panel from Python to avoid clicking each time on Tools->RunControl. Is it possible?
  • How can I change size of the PlotShape window? I tried this:

Code: Select all

ps = h.PlotShape(True)
ps.view(0,0,0,0,0,0,800,800)
ps.show(0)
But I'm not quite sure what view() params means.

Also each view() call creates a new PlotShape window, so any changes to the ps object applies only to the first PlotShape window which was created (the default size, small one). Is there any way to adjust view on the currently controlled PlotShape window (ps object which I can additionally adjust)?

ted
Site Admin
Posts: 5647
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: GUI RunControl panel and Window size

Post by ted » Tue Dec 03, 2019 11:01 am

How can I start RunControl panel from Python to avoid clicking each time on Tools->RunControl
If you already see the NEURON Main Menu toolbar,
h.nrncontrolmenu()

How did I figure this out?

NEURON's standard run system and much of its GUI interface are defined by code in
nrn/share/nrn/lib/hoc
If you need to find out something about a keyword that is part of the standard run system or GUI, search for it in that directory. In this case, I did
grep RunControl *
and that returned, among other things, this:
stdrun.hoc: xbutton("RunControl", "nrncontrolmenu()")

Be sure to read the Programmer's Reference entry about xbutton().
How can I change size of the PlotShape window?
Bring one up, drag it to where you want it on the screen, then save it by itself to a .ses file, and examine the contents of that file with a text editor to discover the names of the functions that are used. Next, manually resize it, then save it to a new .ses file, and examine the contents of the new ses file and (re-)read the relevant Programmer's Reference entries to discover which parameters control size and which ones control position.
Also each view() call creates a new PlotShape window, so any changes to the ps object applies only to the first PlotShape window which was created (the default size, small one). Is there any way to adjust view on the currently controlled PlotShape window (ps object which I can additionally adjust)?
I think you'll discover that you only want to execute view() one time. If you need to call it more than once, you'll probably want to unmap the PlotShape window before each additional execution of view().

Post Reply