bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.23k stars 54 forks source link

[BUG] Slider doesn't handle resizing properly #9

Closed bczsalba closed 2 years ago

bczsalba commented 2 years ago

Describe the bug When resizing a window or container with a Slider inside, the Slider will only update its line length after the second update, causing it to raise a LineLengthError.

To Reproduce

  1. Create a Window
  2. Add a Slider
  3. Resize window to become smaller

Expected behavior The slider should update its width.

System information

PyTermGUI v1.0.1
Python: 3.9.9
Platform: macOS-12.0.1-arm64-arm-64bit
Git commit: ec879a5

Possible cause The Slider.get_lines method doesn't properly handle resizing.