0

I am reading song progress from a phone and the duration of the postion and trying to make a stauts bar on how much is played so far

this below is added for a reference where one of the variable comes from

        testingdur=str(Duration[0].decode('utf-8'))
        durationString = str(testingdur.replace("Duration: ",""))
        durationString = durationString.rstrip()
        print("Duration is "+durationString)

here is the part thats giving me a issure with trying a making the bar step along

        durationStringint = int(durationString)
        Posint=int(PositionCur)
        style.theme_use('alt')
        style.configure("black.Horizontal.TProgressbar", forground='green', background='white', borderwidth=0)
        bar = Progressbar(root, length=1000, style='black.Horizontal.TProgressbar', maximum=durationStringint, variable=Posint, mode='determinate')

The bar does nothing it draws on screen i can see where the bar is but it does not move but i can plug number into the values manually a restart it and it works with fixed numbers

was wondering if any one could give me any advice on how to fix the issue

Kyle M
  • 11
  • 2
  • Wher do you update the `Progressbar['value']`? – stovfl May 25 '20 at 19:23
  • @stovfl Do i need to have the value update even tho i am using a variable to control the bar with variable=Posint – Kyle M May 26 '20 at 00:43
  • The option *`variable=`* refers to [The Variable Classes](http://effbot.org/tkinterbook/variable.htm). You are using a `int`. You have to update either `Progressbar['value'] +=` or the associated `variabel=` using `.set(x)`. – stovfl May 26 '20 at 07:06
  • Does this answer your question? [Progressbar](https://stackoverflow.com/a/7310778/7414759) – stovfl May 26 '20 at 07:12
  • @stovfl Thank you thats helped a lot appreciate it – Kyle M May 27 '20 at 17:29
  • Consider to close as duplicate or write a own answer you can accept yourself to show your solution or delete the question. – stovfl May 27 '20 at 18:33

0 Answers0