Problem with the color setter of the Canvas element interface
Hi,
When I create a canvas object for a rectangle with the element interface, I couldn't change the color. I implemented the following:
my_canvas = Canvas() # Element interface my_canvas['my_rect'] = Rect(-10, -10, 20, 20, fill=True, color='red') my_canvas.show() clock.sleep(1000) my_canvas['my_rect'].color = 'green' my_canvas.show()
It complains with:
my_canvas['my_rect'].color = 'green' ^^^^^^^^^^^^^^^ File "D:\opensesame_4.0.5\Lib\site-packages\openexp\_canvas\_element\element.py", line 232, in _setter val = color(self.experiment, val) ^^^^^ NameError: name 'color' is not defined
Did I implement this correctly? By the way, color setting with the function interface works fine.
Best, Martin
Comments
Hi @MartinS ,
Thanks for pointing this out! It's a bug, which should be fixed in the next maintenance release (4.0.15) that you can install through the automatic updater.
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!