| 3202 | Widget.__init__(self, master, 'checkbutton', cnf, kw) |
| 3203 | |
| 3204 | def _setup(self, master, cnf): |
| 3205 | # Because Checkbutton defaults to a variable with the same name as |
| 3206 | # the widget, Checkbutton default names must be globally unique, |
| 3207 | # not just unique within the parent widget. |
| 3208 | if not cnf.get('name'): |
| 3209 | global _checkbutton_count |
| 3210 | name = self.__class__.__name__.lower() |
| 3211 | _checkbutton_count += 1 |
| 3212 | # To avoid collisions with ttk.Checkbutton, use the different |
| 3213 | # name template. |
| 3214 | cnf['name'] = f'!{name}-{_checkbutton_count}' |
| 3215 | super()._setup(master, cnf) |
| 3216 | |
| 3217 | def deselect(self): |
| 3218 | """Put the button in off-state.""" |