Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] changing color of rect in canvas fails in latest OS 4 #811

Closed
eort opened this issue Feb 21, 2024 · 1 comment
Closed

[BUG] changing color of rect in canvas fails in latest OS 4 #811

eort opened this issue Feb 21, 2024 · 1 comment

Comments

@eort
Copy link
Collaborator

eort commented Feb 21, 2024

See forum:

To reproduce:

my_canvas = Canvas()

my_canvas['rect'] = Rect(-100, -100, 200, 200)

my_canvas['rect'].color = "red" #runtime error that.color does not exist

my_canvas.show()

Produces:


['Traceback (most recent call last):', '  File "/home/ede/tools/miniconda3/envs/opensesame-py3/lib/python3.11/site-packages/libopensesame/inline_script.py", line 84, in run', '    self.workspace._exec(self.crun)', '  File "/home/ede/tools/miniconda3/envs/opensesame-py3/lib/python3.11/site-packages/libopensesame/base_python_workspace.py", line 99, in _exec', '    exec(bytecode, self._globals)  # __ignore_traceback__', '    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', '  File "<string>", line 10, in <module>', '  File "/home/ede/tools/miniconda3/envs/opensesame-py3/lib/python3.11/site-packages/openexp/_canvas/_element/element.py", line 232, in _setter', '    val = color(self.experiment, val)', '          ^^^^^', "NameError: name 'color' is not defined"]
['NoneType: None']

Error: PythonError
@smathot
Copy link
Collaborator

smathot commented Feb 22, 2024

Already fixed in 8eba492. Make sure to test with the latest version!

@smathot smathot closed this as completed Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants