Page 1 of 1

Programmatic GUI control (pressing buttons, etc.)

Posted: Fri Dec 08, 2023 1:25 pm
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.

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

Posted: Fri Dec 15, 2023 1:20 pm
by hines
From the interpreter, there is no way to control the GUI directly. One can only execute the button/menu actions.

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

Posted: Fri Dec 15, 2023 3:23 pm
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.

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

Posted: Sat Dec 16, 2023 1:29 am
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..