israel-dryer / ttkbootstrap

A supercharged theme extension for tkinter that enables on-demand modern flat style themes inspired by Bootstrap.
MIT License
1.79k stars 363 forks source link

Spinbox: bug when setting a float value as increment #500

Open Mxnxl opened 9 months ago

Mxnxl commented 9 months ago

Desktop (please complete the following information):

OS: Linux/Manjaro && Macos ttkbootstrap 1.10.1

Describe the bug

ttk.Spinbox(root, from_=1, to=100, increment=2.4): the value increases/decreases by 2 not 2.4. When increment=2.6, values increases or decreases by 3. When the increment is a float between 0 and 1, the value doesn't change after the first click.

May be a problem with some round function somewhere.

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response

ignis-draco commented 9 months ago

I can confirm this.

Spinbox with ttkbootstrap does not work.

import ttkbootstrap as ttk
root = ttk.Window()
spin = ttk.Spinbox(root,format="%.2f", from_=0, to=100, increment=0.01)
spin.grid(row=0,column=0)
root.mainloop()

If you use the tkinter version everything goes without problems.

import tkinter as tk
import ttkbootstrap as ttk
root = ttk.Window()
spin = tk.Spinbox(root,format="%.2f", from_=0, to=100, increment=0.01)
spin.grid(row=0,column=0)
root.mainloop()