Ah! that documentation is outdated, copied from RatingScale. And, yes, I didn’t get around to adding the demo for Coder yet (there is one for Builder called ratingsNew)
The equivalent code now would be:
while not my_slider.rating:
my_slider.draw()
window.flip()
For any object you can see what’s possible by doing print(dir(something)) so, in your case you could do print(dir(my_slider)) to find the correct options.
Note that there’s also another attribute called my_slider.markerPos that indicates (or can set) the current value of a rating scale before it has been confirmed. e.g. while the marker is being dragged the markerPos will update, and when the mouse is released it will be copied over to my_slider.rating
Thanks for the tip on print(dir(my_slider)) and
The while loop works!, (it helped me isolate the problem further)
The core problem, was that for some reason Slider does not accept specification of units=, either units=pix or units=deg, or when it is inherited from window. Or perhaps my python/psychopy is a bit rusty?
Examples:
# Works!
from psychopy import visual
window = visual.Window((1024,768),fullscr=False,allowGUI=False)
my_slider = visual.Slider(window) # <- unspecified units
my_text = visual.TextStim(window,units="pix")
# Does not work - how I normally use it
window = visual.Window((1024,768),fullscr=False,allowGUI=False,units="pix")
my_slider = visual.Slider(window)
my_text = visual.TextStim(window)
# Does not work
window = visual.Window((1024,768),fullscr=False,allowGUI=False)
my_slider = visual.Slider(window,units="pix")
my_text = visual.TextStim(window,units="pix")
@BronteMckeown, the ability to control Slider units from the Slider dialog box was included in the latest release of PsychoPy (try 3.2.3). You can either upgrade your current version, or go to Experiment Settings > Use Version and select the version you require.