ttkbootstrap icon indicating copy to clipboard operation
ttkbootstrap copied to clipboard

child Window Don't can use meter

Open gtgor opened this issue 1 year ago • 1 comments

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 avatar Jul 24 '24 18:07 gtgor

windows11 python3.10

gtgor avatar Jul 24 '24 18:07 gtgor

You should not create two main event loops in your application. Instead, use a Toplevel window and you will not have this issue.

israel-dryer avatar Mar 31 '25 01:03 israel-dryer