MCPcopy Index your code
hub / github.com/python/cpython / theme_use

Method theme_use

Lib/tkinter/ttk.py:495–507  ·  view source on GitHub ↗

If themename is None, returns the theme in use, otherwise, set the current theme to themename, refreshes all widgets and emits a < > event.

(self, themename=None)

Source from the content-addressed store, hash-verified

493
494
495 def theme_use(self, themename=None):
496 """If themename is None, returns the theme in use, otherwise, set
497 the current theme to themename, refreshes all widgets and emits
498 a <<ThemeChanged>> event."""
499 if themename is None:
500 # Starting on Tk 8.6, checking this global is no longer needed
501 # since it allows doing self.tk.call(self._name, "theme", "use")
502 return self.tk.eval("return $ttk::currentTheme")
503
504 # using "ttk::setTheme" instead of "ttk::style theme use" causes
505 # the variable currentTheme to be updated, also, ttk::setTheme calls
506 # "ttk::style theme use" in order to change theme.
507 self.tk.call("ttk::setTheme", themename)
508
509
510class Widget(tkinter.Widget):

Callers 6

test_theme_useMethod · 0.80
test_map_custom_copyMethod · 0.80
test_theme_createMethod · 0.80

Calls 2

evalMethod · 0.80
callMethod · 0.45

Tested by 6

test_theme_useMethod · 0.64
test_map_custom_copyMethod · 0.64
test_theme_createMethod · 0.64