psychopy.org | Reference | Downloads | Github

Can the gui element be implemented inside trial loop?

Dear all,
Is there any work-around to use gui elements (especially combo-box menu and checkbox) in the trial loop?
I opened and checked the codes and they seem quite independent from the main ‘screen’ scripts.

I could open screen in windows mode, and able to open another window (seems wxpython) of gui components of PsychoPy.

I am wondering if there are any possible workaround to integrate those drop-down (combobox) type menu in main window, which will allow full-screen mode.

Even it does not use gui components, if you know any workaround to use combo-box (drop-down menu) inside the trial loop, please give me some hint.

Thanks.

A window in fullscreen mode wouldn’t be fullscreen if other windows could be displayed in front of it (and receive move and keyboard events). You need to actively minimise your main window to allow another one be seen and interacted with. Read this thread (despite the title, this is not a bug):

Thanks for your reply.

I am trying to integrate them in one window.
(put the drop-down menu inside standard psychopy screen).
Is it impossible now?

I don’t think so. In PsychoPy, in the main window, we control all of the drawing ourselves (except for when the mouse pointer is shown, which is drawn by the operating system). So we can’t show interactive controls from other libraries, as they would need to be controlling the drawing to the window themselves, updating on a frame-by-frame basis in response to user events.

So your alternatives are to show a GUI dialog in a separate window, leaving it to do its own drawing and user responses, or you fake the drawing of user controls yourself in the main window. This is almost always a lot of effort which is not justified.

Note, however, that if you just want to get the user to select between a couple of alternatives, you could just use PsychoPy’s rating scale stimulus, with a couple of discrete values on the scale to choose from.

1 Like