Closed
Description
Bug report
Bug description:
When mixing tk.Checkbutton and ttk.Checkbutton (and maybe custom class Checkbutton)
tkinter behaves weirdly (calling method of one object changes the other too).
It is because of name collision.
import tkinter as tk
from tkinter import ttk
wn = tk.Tk()
tk.Checkbutton(wn)
ttk.Checkbutton(wn)
print(tk.Checkbutton(wn).winfo_name())
print(ttk.Checkbutton(wn).winfo_name())
this example prints
!checkbutton2
!checkbutton2
This happens because of tk.Checkbutton._setup
overriden method
which is not called in ttk.Checkbutton.
I think that that method can be erased, which would solve the problem,
but I'm not sure why it is there in the first place.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
- gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names #116495
- [3.12] gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names (GH-116495) #116901
- [3.11] gh-116484: Fix collisions between Checkbutton and ttk.Checkbutton default names (GH-116495) #116902