import customtkinter as ctk
import tkinter as tk
#Fenster
window = ctk.CTk()
window.title("Startseite")
window.geometry("800*600")
#Erscheinungsbild "system", "light" oder "dark"
ctk.set_appearance_mode("dark") # "light" or "dark or "system"
ctk.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue"
def ausgefunktion_1():
ausgabe_1 = ctk.CTkLabel(window, text = auswahl_1.get()).pack()
print("Deine Auswahl: " + auswahl_1.get())
auswahl_1 = ctk.StringVar()
checkbox_1 = ctk.CTkCheckBox(window, text="PKW",command=ausgefunktion_1, variable=auswahl_1, onvalue="Kosten: 99 € / Tag",
offvalue=" ", border_color="turquoise").pack()
#Schleife
window.mainloop()
"""
Argumente
master root, tkinter.Frame or CTkFrame
width Breite des kompletten Widgets in px
height Höhe des kompletten Widgets in px
checkbox_width Breite der checkbox in px
checkbox_height Höhe der checkbox in px
corner_radius Eckenradius in px
border_width Rendbreite in px
fg_color Vordergrund (innen) Farbe, tuple: (light_color, dark_color) oder einzelne Farbe
border_color Randfarbe, tuple: (light_color, dark_color) oder einzelne Farbe
hover_color hover - Farbe, tuple: (light_color, dark_color) oder einzelne Farbe
text_color Textfarbe, tuple: (light_color, dark_color) oder einzelne Farbe
text_color_disabled Textfarbe wenn deaktiviert, tuple: (light_color, dark_color) oder einzelne Farbe
textvariable Tkinter StringVar zur Steuerung des Textes
font Schaltflächen - Text-Art, tuple: (font_name, size)
hover enable/disable hover effect: True, False
state tkinter.NORMAL (standard) oder tkinter.DISABLED (nicht anklickbar, dunklere Farbe)
command Die Funktion wird aufgerufen, wenn das Kontrollkästchen angeklickt wird
variable Tkinter-Variable zum Steuern oder Lesen des Kontrollkästchenstatus
onvalue string oder int für Variable im geprüften Zustand
offvalue string oder int für Variable im ungeprüften Zustand
"""
In questa pagina del sito puoi guardare il video online Python - customtkinter CheckBox della durata di ore minuti seconda in buona qualità , che l'utente ha caricato ANDREEs 13 July 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 87 volte e gli è piaciuto 2 spettatori. Buona visione!