israel-dryer/ttkbootstrap

Spinbox: bug when setting a float value as increment

Mxnxl opened this issue · 1 comments

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

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()