Construct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.
(self, master, widgetName, cnf={}, kw={}, extra=())
| 2845 | self.master.children[self._name] = self |
| 2846 | |
| 2847 | def __init__(self, master, widgetName, cnf={}, kw={}, extra=()): |
| 2848 | """Construct a widget with the parent widget MASTER, a name WIDGETNAME |
| 2849 | and appropriate options.""" |
| 2850 | if kw: |
| 2851 | cnf = _cnfmerge((cnf, kw)) |
| 2852 | self.widgetName = widgetName |
| 2853 | self._setup(master, cnf) |
| 2854 | if self._tclCommands is None: |
| 2855 | self._tclCommands = [] |
| 2856 | classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)] |
| 2857 | for k, v in classes: |
| 2858 | del cnf[k] |
| 2859 | self.tk.call( |
| 2860 | (widgetName, self._w) + extra + self._options(cnf)) |
| 2861 | for k, v in classes: |
| 2862 | k.configure(self, v) |
| 2863 | |
| 2864 | def destroy(self): |
| 2865 | """Destroy this and all descendants widgets.""" |