Skip to content

[ Bug/Question] Is it possible to update the position of a slider element? #4201

@sequeirayeslin

Description

@sequeirayeslin

Type of Issue (Enhancement, Error, Bug, Question)

Bug/ Question


Operating System

Windows 10

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()

Python version (sg.sys.version)

3.8.3

PySimpleGUI Version (sg.__version__)

4.39.1

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.9


Your Experience In Months or Years (optional)

Years Python programming experience
5 months
Years Programming experience overall
1 year
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
no
Anything else you think would be helpful?


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

I tried using the update method on the slider, but it doesnt do anything. I'm trying to make a seek bar to use with python-vlc.

Update:
The update method seems to work, but it's effects seem to appear only after an event occurs.
I added a button to my code below to demonstrate this.

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:

# Paste your code here
    
import PySimpleGUI as sg

layout = [[sg.Slider(range=(1, 100), orientation='h', size=(20, 20), default_value=1, disable_number_display = True, key = "slider"), sg.Button("click me")]]

window = sg.Window("Window", layout)
while True:
    window.read()
    window['slider'].update(value = 10)
        

Screenshot, Sketch, or Drawing

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions