| 3283 | Widget.__init__(self, master, 'checkbutton', cnf, kw) |
| 3284 | |
| 3285 | def _setup(self, master, cnf): |
| 3286 | # Because Checkbutton defaults to a variable with the same name as |
| 3287 | # the widget, Checkbutton default names must be globally unique, |
| 3288 | # not just unique within the parent widget. |
| 3289 | if not cnf.get('name'): |
| 3290 | global _checkbutton_count |
| 3291 | name = self.__class__.__name__.lower() |
| 3292 | _checkbutton_count += 1 |
| 3293 | # To avoid collisions with ttk.Checkbutton, use the different |
| 3294 | # name template. |
| 3295 | cnf['name'] = f'!{name}-{_checkbutton_count}' |
| 3296 | super()._setup(master, cnf) |
| 3297 | |
| 3298 | def deselect(self): |
| 3299 | """Put the button in off-state.""" |