# Changing the position of the slider during a loop

**URL:** <https://discourse.psychopy.org/t/changing-the-position-of-the-slider-during-a-loop/34971>\
**Category:** Coding\
**Tags:** randomization\
**Created:** [May 21, 2023, 7:57am UTC](https://discourse.psychopy.org/t/changing-the-position-of-the-slider-during-a-loop/34971 "2023-05-21T07:57:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [May 22, 2023, 10:43am UTC](https://discourse.psychopy.org/t/changing-the-position-of-the-slider-during-a-loop/34971/2 "2023-05-22T10:43:41Z")

</div>

Hello,

It seems that the Slider is still bugged when it comes to setting the Position-parameter. As soon as you set the Position-parameter to “set every repeat” from **constant** , the position will be set to [0,0], no matter what you want it to be. You can check this by looking at the compiled Python script.

**set every repeat**

```auto
slider = visual.Slider(win=win, name='slider',
    startValue=None, size=(1, .1), pos=[0,0], units=None,
    labels=[1,2,3,4,5], ticks=(1, 2, 3, 4, 5), 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=-1, readOnly=False)

```

should be

```auto
slider = visual.Slider(win=win, name='slider',
    startValue=None, size=(1, .1), pos=(0, -.2), units=None,
    labels=[1,2,3,4,5], ticks=(1, 2, 3, 4, 5), 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=-1, readOnly=False)

```

see here for an earlier mentioning of the problem

> [@Bug report: Slider component position & clickability](https://discourse.psychopy.org/t/bug-report-slider-component-position-clickability/7688):
>
> OS (e.g. Win10): Mac OX 10.14.4 PsychoPy version (e.g. 1.84.x): 3.1.0 \*\*Standard Standalone? YES I have identified 2 problems with the builder slider component, both when in use as radio buttons: a) when you set the stimPos to update on repeat (i.e. variable), this does not translate over to coder – the script does not represent this and simply has [0,0] pos in the original initialization, but then does not put in code before the trial runs. TextStims whose pos is similarly determined DO upd…

or see here

> <https://github.com/psychopy/psychopy/pull/5136>

but according to this is issue is closed. So, it should work.

I’ve been using 2022.2.5, perhaps 2023.1.2 does a better job.

Best wishes Jens

---

_[View the full topic](https://discourse.psychopy.org/t/changing-the-position-of-the-slider-during-a-loop/34971)._
