2025-07-22

Python tkinter tk.Button és ttk.Button opciók

# Python 3.12

import tkinter  as tk
from tkinter import ttk



ablak = tk.Tk()

btn1 = ttk.Button(ablak, text="próba")
btn1.pack()


print('ttk.Button')
for i in btn1.configure().keys():
print(f'{i}=')
# command=
# default=
# takefocus=
# text=
# textvariable=
# underline=
# width=
# image=
# compound=
# padding=
# state=
# cursor=
# style=
# class=

print('\n------------------------------------------------------------------------\n')

btn2 = tk.Button(ablak, text="próba")
btn2.pack()

print('tk.Button')
for i2 in btn2.configure().keys():
print(f'{i2}=')
# activebackground=
# activeforeground=
# anchor=
# background=
# bd=
# bg=
# bitmap=
# borderwidth=
# command=
# compound=
# cursor=
# default=
# disabledforeground=
# fg=
# font=
# foreground=
# height=
# highlightbackground=
# highlightcolor=
# highlightthickness=
# image=
# justify=
# overrelief=
# padx=
# pady=
# relief=
# repeatdelay=
# repeatinterval=
# state=
# takefocus=
# text=
# textvariable=
# underline=
# width=
# wraplength=

ablak.mainloop() 


Nincsenek megjegyzések:

Megjegyzés küldése