Hier der code:
import customtkinter as ctk
import tkinter as tk
#Fenster
window = ctk.CTk()
window.title("mein GUI")
window.geometry("800+600")
#Erscheinungsbild "system", "light" oder "dark"
ctk.set_appearance_mode("dark") # "light" or "dark or "system"
#ctk.set_default_color_theme("green") # Themes: "blue" (standard), "green", "dark-blue" z.B. buttons etc.
#Text-Widget
label = ctk.CTkLabel(window,
text = "welcome",
fg_color = "#40E0D0", # tuple → Farbe in light- bzw. dark-mode
text_color = ("white", "white"), # tuple → Farbe in light- bzw. dark-mode
font=('Times', 80),
corner_radius = 11)
label.pack(pady=220)
#Schleife
window.mainloop()
ARGUMENTE:
master root, tkinter.Frame or CTkFrame
textvariable tkinter.StringVar object
text string
width label width in px
height label height in px
corner_radius corner radius in px
fg_color foreground color, tuple: (light_color, dark_color) or single color or "transparent"
text_color label text color, tuple: (light_color, dark_color) or single color
font label text font, tuple: ("font_name", size)
anchor controls where the text is positioned if the widget has more space than the text needs, default is "center"
compound control the postion of image relative to text, default is "center, other are: "top", "bottom", "left", "right"
justify specifies how multiple lines of text will be aligned with respect to each other: "left" for flush left, "center" for centered (the default), or "right" for right-justified
padx extra space added left and right of the text, default is 1
pady extra space added above and below the text, default is 1
On this page of the site you can watch the video online Python - GUI mit customtkinter EINSTIEG text label with a duration of hours minute second in good quality, which was uploaded by the user ANDREEs 27 June 2023, share the link with friends and acquaintances, this video has already been watched 380 times on youtube and it was liked by 3 viewers. Enjoy your viewing!