You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a demo sketch of the issue. Essentially the problem is that it doesn't show that it's checked when it is. To see with and without the issue comment out the "sv_ttk.set_theme("dark")" near the bottom.
import sv_ttk
import tkinter as tk
class CustomWidget(tk.Frame):
def __init__(self, master, text, row, column, *args, **kwargs):
super().__init__(master, *args, **kwargs)
# Label on the left
self.label = tk.Label(self, text=text)
self.label.grid(row=row, column=column, padx=5)
# Checkbox in the middle
self.var = tk.IntVar()
self.checkbox = tk.Checkbutton(self, variable=self.var, command=self.update_led)
self.checkbox.grid(row=0, column=1)
# Status LED on the right
self.led_size = 20
self.canvas = tk.Canvas(self, width=self.led_size, height=self.led_size)
self.canvas.grid(row=0, column=2, padx=5)
self.led = self.canvas.create_oval(
self.led_size / 2 - 5, self.led_size / 2 - 5,
self.led_size / 2 + 5, self.led_size / 2 + 5,
fill="red"
)
def update_led(self):
color = "green" if self.var.get() else "red"
self.canvas.itemconfig(self.led, fill=color)
root = tk.Tk()
sv_ttk.set_theme("dark")
custom_widget = CustomWidget(root, "Example Text", 0,0)
custom_widget.pack()
root.mainloop()
The text was updated successfully, but these errors were encountered:
Here is a demo sketch of the issue. Essentially the problem is that it doesn't show that it's checked when it is. To see with and without the issue comment out the "sv_ttk.set_theme("dark")" near the bottom.
The text was updated successfully, but these errors were encountered: