If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): 10
PsychoPy version (e.g. 1.84.x): 2022.1.3
Standard Standalone? (y/n) If not then what?: y
I want to change the number of options/ticks and also the associated labels on each trial in a trial loop. This used to work last year using .setLabels() but this appears to have been deprecated and I haven’t been able to get it working locally.
Any one got any suggestions?
Thanks
update:
ticks can be updated in a code block in the routine above the slider component however updating the labels in code in the same manner does not get implemented on screen
eg
slider_volume.ticks = np.array((3,4,5)) # works
slider_volume.labels = (‘a’,‘b’,‘c’) # original labels are retained
Easiest work around was just to create the slider in the ‘begin routine’ section of a code block on each trial repeat having first pre-initialised the lists you use below to populate the ticks and labels parameters. now working fine
eg
slider_volume = visual.Slider(win=win, name=‘slider_volume’,
startValue=start_value, size=(1.0, 0.1), pos=(0, -0.1), units=None,
labels=slider_labels, ticks=slider_options, granularity=1.0,
style=‘rating’, styleTweaks=(), opacity=None,
labelColor=‘LightGray’, markerColor=‘Red’, lineColor=‘White’, colorSpace=‘rgb’,
font=‘Open Sans’, labelHeight=0.05,
flip=False, ori=0.0, depth=-2, readOnly=False)