Programmatic GUI control (pressing buttons, etc.)

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc or Python
Post Reply
mig
Posts: 2
Joined: Wed May 31, 2023 1:52 pm

Programmatic GUI control (pressing buttons, etc.)

Post by mig »

I have a fairly complex and fluid HOC wrapper around NEURON with a bunch of dynamic windows, menus, radio buttons, values, etc. I need to be able to automatically test that the wrapper operates correctly and output results match correct/expected values. And test this for a variety of menu choices and test input parameters.

Simulating selections for {xmenu, xpanel, xradiobutton, xcheckbox} (e.g. by choosing the menu "option1" or "option2") and keyboard inputs for {xvalue, xpvalue} via a Python script would seem optimal. But AFAICS there is no built-in mechanism to programmatically control NEURON GUI. I tried using external tools like AutoIt but, unfortunately, it is unable to see any NEURON GUI objects apart from the top-level GUI windows.

Any ideas about how to programmatically control NEURON GUI widgets would be appreciated.
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Programmatic GUI control (pressing buttons, etc.)

Post by hines »

From the interpreter, there is no way to control the GUI directly. One can only execute the button/menu actions.
mig
Posts: 2
Joined: Wed May 31, 2023 1:52 pm

Re: Programmatic GUI control (pressing buttons, etc.)

Post by mig »

In popular Python GUI packages like Tkinter there is an invoke() method which allows activation of GUI elements. If an equivalent existed in NEURON it would be really great and I am sure many enough folks would find it useful. I know I would. Also, my guess is that it might make automated testing of NEURON itself easier and more comprehensive?

I even thought of modifying the NEURON sources from github myself, but the GUI code (relevant parts are in src/ivoc/xmenu.cpp file) looks fairly complex so, sadly, I did not go very far.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Programmatic GUI control (pressing buttons, etc.)

Post by ted »

NEURON's existing GUI is implemented with InterViews, which doesn't offer such functionality. There has been some work to develop a new GUI, but most development efforts have focussed on performance, taking advantage of new CPU architectures, code reorganization, and improving the development process itself. Development is open source and you're welcome to join the team and focus on a new GUI if you have the time, interest, etc..
Post Reply