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

Method theme_create

Lib/tkinter/ttk.py:461–475  ·  view source on GitHub ↗

Creates 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 specified parent theme. If settings are present, they are expected to have the same syntax used for theme_setting

(self, themename, parent=None, settings=None)

Source from the content-addressed store, hash-verified

459
460
461 def theme_create(self, themename, parent=None, settings=None):
462 """Creates a new theme.
463
464 It is an error if themename already exists. If parent is
465 specified, the new theme will inherit styles, elements and
466 layouts from the specified parent theme. If settings are present,
467 they are expected to have the same syntax used for theme_settings."""
468 script = _script_from_settings(settings) if settings else ''
469
470 if parent:
471 self.tk.call(self._name, "theme", "create", themename,
472 "-parent", parent, "-settings", script)
473 else:
474 self.tk.call(self._name, "theme", "create", themename,
475 "-settings", script)
476
477
478 def theme_settings(self, themename, settings):

Callers 3

test_theme_createMethod · 0.80

Calls 2

_script_from_settingsFunction · 0.85
callMethod · 0.45

Tested by 3

test_theme_createMethod · 0.64