harshvinay752 / RangeSlider

Python tkinter widget for range selection in slider widget structure with two handles
MIT License
11 stars 4 forks source link

Pos Error when used with ttkbootstrap #10

Open AritraGhosalatIEM opened 2 weeks ago

AritraGhosalatIEM commented 2 weeks ago

I am using ttkbootstrap, inserting a RangeSliderH into a Frame using the grid method and I get the following error:

  File "/home/cab1729/.local/lib/python3.12/site-packages/RangeSlider/RangeSlider.py", line 138, in __init__
    bar["Ids"] = self.__addBar(bar["Pos"],tempIdx)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cab1729/.local/lib/python3.12/site-packages/RangeSlider/RangeSlider.py", line 232, in __addBar
    raise Exception("Pos error - Pos: "+str(pos))
Exception: Pos error - Pos: 4.0

Your code seems to allow values only between 0 and 1. I can scale it to my needed value range but the issue the value displays above the slider.

harshvinay752 commented 2 weeks ago

Hey @AritraGhosalatIEM, it will be easy to find the issue, if you could post the code, specially the lines of code used for instantiating a RangeSliderH. The above exception occurs when you try to instantiate a RangeSliderH with variable having value (position of slider here) out of bound as defined using min_val and max_value arguments defaulting to 0 and 1 respectively.