israel-dryer / ttkbootstrap

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

child Window Don't can use meter #593

Open gtgor opened 3 months ago

gtgor commented 3 months ago

Desktop (please complete the following information):

I needed to use meter in a child window, and the program threw an error, which I assumed was due to a default conflict

Describe the bug

Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\tkinter__init.py", line 1921, in call__ return self.func(*args) File "C:\Projects\alloy\venv\lib\site-packages\ttkbootstrap\widgets.py", line 953, in _on_theme_change self._draw_base_image() File "C:\Projects\alloy\venv\lib\site-packages\ttkbootstrap\widgets.py", line 862, in _draw_base_image self._set_widget_colors() File "C:\Projects\alloy\venv\lib\site-packages\ttkbootstrap\widgets.py", line 773, in _set_widget_colors self._meterbackground = Colors.update_hsv(background, vd=-0.1) File "C:\Projects\alloy\venv\lib\site-packages\ttkbootstrap\style.py", line 369, in update_hsv r, g, b = Colors.hex_to_rgb(color) File "C:\Projects\alloy\venv\lib\site-packages\ttkbootstrap\style.py", line 317, in hex_to_rgb r, g, b = colorutils.color_to_rgb(color) TypeError: cannot unpack non-iterable NoneType object

To Reproduce

I managed to repeat the mistake in a new dame

import ttkbootstrap as ttk def windows1(): root=ttk.Window() ttk.Button(root,command=lambda : windows2()).pack() root.mainloop()

def windows2(): win=ttk.Window() ttk.Meter(win).pack() win.mainloop() windows1()

Expected behavior

In general, mater can be successfully deployed on win

Screenshots

No response

Additional context

No response

gtgor commented 3 months ago

windows11 python3.10