tkinter.ttk.Treeview

class tkinter.ttk.Treeview bbox(item, column=None) Returns the bounding box (relative to the treeview widget’s window) of the specified item in the form (x, y, width, height). If column is specified, returns the bounding box of that cell. If the item is not visible (i.e., if it is a descendant of a closed item or is scrolled offscreen), returns an empty string. get_children(item=None) Returns the list of children belonging to item. If item is not specified, returns root children.

tkinter.ttk.Style.theme_use()

theme_use(themename=None) If themename is not given, returns the theme in use. Otherwise, sets the current theme to themename, refreshes all widgets and emits a <<ThemeChanged>> event.

tkinter.ttk.Style.theme_settings()

theme_settings(themename, settings) Temporarily sets the current theme to themename, apply specified settings and then restore the previous theme. Each key in settings is a style and each value may contain the keys ‘configure’, ‘map’, ‘layout’ and ‘element create’ and they are expected to have the same format as specified by the methods Style.configure(), Style.map(), Style.layout() and Style.element_create() respectively. As an example, let’s change the Combobox for the default theme a bit:

tkinter.ttk.Style.theme_names()

theme_names() Returns a list of all known themes.

tkinter.ttk.Style.theme_create()

theme_create(themename, parent=None, settings=None) Create a new theme. It is an error if themename already exists. If parent is specified, the new theme will inherit styles, elements and layouts from the parent theme. If settings are present they are expected to have the same syntax used for theme_settings().

tkinter.ttk.Style.map()

map(style, query_opt=None, **kw) Query or sets dynamic values of the specified option(s) in style. Each key in kw is an option and each value should be a list or a tuple (usually) containing statespecs grouped in tuples, lists, or some other preference. A statespec is a compound of one or more states and then a value. An example may make it more understandable: import tkinter from tkinter import ttk root = tkinter.Tk() style = ttk.Style() style.map("C.TButton", foreground=[('pressed',

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: from tkinter import ttk print(ttk.Style().lookup("TButton", "font"))

tkinter.ttk.Style.layout()

layout(style, layoutspec=None) Define the widget layout for given style. If layoutspec is omitted, return the layout specification for given style. layoutspec, if specified, is expected to be a list or some other sequence type (excluding strings), where each item should be a tuple and the first item is the layout name and the second item should have the format described in Layouts. To understand the format, see the following example (it is not intended to do anything useful): from tkinter im

tkinter.ttk.Style.element_options()

element_options(elementname) Returns the list of elementname‘s options.

tkinter.ttk.Style.element_names()

element_names() Returns the list of elements defined in the current theme.