Slider cannot be changed in code when using builder

If this template helps then use it. If not then just delete and start from scratch.

Win10 & Mac
PsychoPy version = v2021.2.3
Standard Standalone? y
What are you trying to achieve?

I built an experiment using a builder and some specific code utilizing the code component in the builder.
I am trying to adjust a slider size during the experiment to ensure that it’s size is optimal. Example of what I am doing is here

I added a slider component using builder and then used the code component to adjust the slider size at the beginning of the routine.
code1

I got an attribution error here

When I tried updating the size in the builder by setting size to every repeat

I got this error

Also, I am unable to change the spatial units for the slider. All these errors were when I ran it locally on my computer. Are we able to modify the slider in the experiment? I need to use the builder because I want to run it online later on.

Does anyone knows what is wrong?

Sliders can be a bit temperamental online. Have a look at my interactive slider online demo for an example of me using the slider component and also replacing it with a code version.

Yes but I get this error when running it on my computer. I have not even tried running this version online.

My demo should run offline as well so you can see what code I’ve tried. I know you can’t dynamically change the number of tick marks.

I’m on my mobile so don’t have direct access to my code

Thanks Wakecarter. I found your code and I will give it a look and try it out later.

1 Like