Skip to content

onChange #12

@konsumer

Description

@konsumer

Pardon if this is a dumb question (I don't normally use tkinter) but how do I bind to changing value?

Like I have this, and I want to fire my callback on change:

import customtkinter
from tkdial import Dial

customtkinter.set_appearance_mode("Dark") 
app = customtkinter.CTk()

dials = [
  Dial(app, radius=40, text_color="white", text="u_x0:", color_gradient=("blue", "red")),
  Dial(app, radius=40, text_color="white", text="u_x1:", color_gradient=("blue", "red")),
  Dial(app, radius=40, text_color="white", text="u_x2:", color_gradient=("blue", "red")),
  Dial(app, radius=40, text_color="white", text="u_x3:", color_gradient=("blue", "red")),
]

i=0
for dial in dials:
  i = i+1
  dial.grid(padx=10, pady=10, row=0, column=i)

# TODO: add callback on change

app.mainloop()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions