| Reference | Downloads | Github

Slider (with default marker position) stacked on image stimuli


I am currently struggling with the visibility of my slider, when coded in a code snippet. The slider should appear on top of an image to simulate kind of the interactivity of a webpage.
As long as I implement the slider as a psychopy build-in component there is no problem with the visibility, but when I write the code I copied in the following in a code component the slider does not appear - independent on what position of the order (on top, middle, bottom) I place it.

SliderOffset = visual.Slider(win=win, name=‘SliderOffset’,
size=(.5, .05), pos=(0, -0.2),
labels=[‘No’, ‘Yes’], ticks=(0, 1),
granularity=0, style=(‘slider’),
color=‘gray’, font=‘Arial’,
flip=False, labelHeight = .025)
SliderOffset.marker.size = (.05, .05)
SliderOffset.markerPos = 1

It should look like this in the end but already with a default setting:

(there is an image, clickable stimuli ‘continue’ on top, mouse input, and the slider)

The problem is, that I need something like a toggle switch with a default option (either yes/ no) to manipulate it per group. This is only possible within the coder.

I also tried to import external libs like dash (dash_daq.ToggleSwitch | Dash for Python Documentation | Plotly), but failed in importing it. What I did was download the package, unzip it and change the file extension from .tar to .pth and put the file into the site-package folder.

Has someone an idea why 1. the slider does not show up on top of the picture when implemented as code, and 2. does someone know how the correct process is to import external libs (what I did seems somehow wrong but I don’t have any better idea).