Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How can I customize forms in inline_script?

Hello,

I'm trying to change the theme of my form. This is part of my code:

var.i=0

while var.i < len(var.response_letters):

form_JOCp = Form (cols=[1,3,1], rows=[1,2,3,2,3,1],margins=(20,140,20,140),theme=u'blue')

form_JOCa = Form (cols=[1,3,1], rows=[1,1,2,3,2,3,1],margins=(20,140,20,140))

label_recallp = Label(text=f"Votre réponse était : <span style='font-size: 33px;'><span style='color:blue;'><b>{var.response_letters}</b></span>")


And I got this error message:

File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\inline_script.py", line 116, in run

  self.workspace._exec(self.crun)

 File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec

  exec(bytecode, self._globals)

 Inline script, line 6, in <module>

 File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\python_workspace_api.py", line 64, in Form

  return form(experiment, **kwargs)

 File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\widgets\_form.py", line 137, in __init__

  u'libopensesame.widgets.themes.%s' % theme, fromlist=[u'dummy'])

ModuleNotFoundError: No module named 'libopensesame.widgets.themes.blue'


At some point, few years ago, Sebastian shared a link with some info about this; but, it seems that it no longer works. So, I would appreciate any guidance on this matter.

Thanks in advance.

Comments

  • Hi Gio,

    I think there are only two themes. Plain and gray. They also look quite similar, so unfortunately, there are not that many options to customize forms in terms of color, etc.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.