tkinter.ttk.Style.lookup()

lookup(style, option, state=None, default=None)

Returns the value specified for option in style.

If state is specified, it is expected to be a sequence of one or more states. If the default argument is set, it is used as a fallback value in case no specification for option is found.

To check what font a Button uses by default:

1
2
3
from tkinter import ttk
 
print(ttk.Style().lookup("TButton", "font"))
doc_python
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.