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)
| 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): |