Construct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.
(self, master, widgetName, cnf={}, kw={}, extra=())
| 2762 | self.master.children[self._name] = self |
| 2763 | |
| 2764 | def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): |
| 2765 | """Construct a widget with the parent widget MASTER, a name WIDGETNAME |
| 2766 | and appropriate options.""" |
| 2767 | if kw: |
| 2768 | cnf = _cnfmerge((cnf, kw)) |
| 2769 | self.widgetName = widgetName |
| 2770 | self._setup(master, cnf) |
| 2771 | if self._tclCommands is None: |
| 2772 | self._tclCommands = [] |
| 2773 | classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)] |
| 2774 | for k, v in classes: |
| 2775 | del cnf[k] |
| 2776 | self.tk.call( |
| 2777 | (widgetName, self._w) + extra + self._options(cnf)) |
| 2778 | for k, v in classes: |
| 2779 | k.configure(self, v) |
| 2780 | |
| 2781 | def destroy(self): |
| 2782 | """Destroy this and all descendants widgets.""" |