[solved] Python inline script: Widgets in form overlapping
Hello,
I recently updated Open Sesame to the newest version 2.8.1. Unfortunately, I now always get an error message in a python inline script stating me that one or more widgets in my form are overlapping. However, I cannot find the overlap. Is there an option to see which widgets are overlapping and causing the error message to occur?
Or maybe, I am too blind to find the overlap:
form_pdg_test.set_widget(choice_heading, (0,10), colspan=100,rowspan=8)
form_pdg_test.set_widget(choice_question, (50,28), colspan=10,rowspan=7)
form_pdg_test.set_widget(checkbox_c, (43,36),colspan=16,rowspan=4)
form_pdg_test.set_widget(checkbox_d, (57,36),colspan=16,rowspan=4)
form_pdg_test.set_widget(o_choice, (17,44), colspan=15, rowspan=4)
form_pdg_test.set_widget(o_coop, (32,41), colspan=10, rowspan=4)
form_pdg_test.set_widget(o_defect, (32,48), colspan=10, rowspan=4)
form_pdg_test.set_widget(s_reward, (42,41), colspan=10, rowspan=2)
form_pdg_test.set_widget(o_reward, (46,43), colspan=10, rowspan=2)
form_pdg_test.set_widget(s_sucker, (42,48), colspan=10, rowspan=2)
form_pdg_test.set_widget(o_temptation, (46,50), colspan=10, rowspan=2)
form_pdg_test.set_widget(s_temptation, (56,41), colspan=10, rowspan=2)
form_pdg_test.set_widget(o_sucker, (60,43), colspan=10, rowspan=2)
form_pdg_test.set_widget(s_punish, (56,48), colspan=10, rowspan=2)
form_pdg_test.set_widget(o_punish, (60,50), colspan=10, rowspan=2)
form_pdg_test.set_widget(finished_button_mc, (45,60),colspan=10,rowspan=5)
Thank you in advance for your help!
Best regards,
Isabel
Comments
Hi Isabel,
It's a bit difficult to spot by eye (you have so many columns and rows!), but you could debug this fairly easily by inserting a
print
statement after everyset_widget()
, like so:Then you can see in the debug window what the last printed digit is, and you know that the next widget is the problem.
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastian,
Thank you very much for your quick response. I tried the solution you recommended, but still I can't fix the problem. All the numbers that I define in the print statements after each set_widget (in the prepare phase) are indeed printed in the debug window. However, there seems to be a problem with a widget (a warning message) that I call in the run phase of the inline script. But even when I delete this widget, the error message still occurs.
Do you have another idea for me on how to fix the problem. And by the way: sorry for the mess in my code and the huge number of cells !
Cheers,
Isabel
Hi Isabel,
Right, I forgot that the geometry is only validated when you execute the form, so you wouldn't get this error after
set_widget()
. That's inconvenient. Could you post the full script, i.e. including the bits where you create the widgets and execute the form?Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastian,
Of course, please find the full script below.
Thanks again for your help!
Cheers,
Isabel
Ok, it's these two:
43 + 16 > 57
, and therefore the two widgets overlap. Reducing thecolspan
for checkbox_c to 14 will do the trick. (However, aesthetically, I feel that there is more room for improvement!)Check out SigmundAI.eu for our OpenSesame AI assistant!
Dear Sebastian,
Thank you very much for your help! That was a typical example of blindness...sorry!
And, of course, you're right. Aesthetically, it can (and will) be further improved.
Best regards,
Isabel