Message286552
Report and code from George Trojan on python-list.
import tkinter
class GUI(tkinter.Tk):
def __init__(self):
tkinter.Tk.__init__(self)
frame = tkinter.Frame(self)
for tag in ('A', 'B'):
w = tkinter.Checkbutton(frame, text=tag)
w.pack(side='top', padx=10, pady=10)
print(w)
frame.pack(side='top')
frame = tkinter.Frame(self)
for tag in ('C', 'D'):
w = tkinter.Checkbutton(frame, text=tag)
w.pack(side='top', padx=10, pady=10)
print(w)
frame.pack(side='top')
gui = GUI()
gui.mainloop()
In 3.5, each Checkbutton has unique last name component.
.2028654224384.2028654606600
.2028654224384.2028654608224
.2028654606656.2028654606824
.2028654606656.2028654608336
Clicking any box checks or unchecks exactly that box.
In 3.6, last name components are duplicated
.!frame.!checkbutton
.!frame.!checkbutton2
.!frame2.!checkbutton
.!frame2.!checkbutton2
Clicking any box checks or unchecks both button with 'same name'.
I verified that the _w strings passed in tk.call are the full unique names.
MRAB reported that adding a tk variable attribute fixed the problem. I notice that Brian Oakley said the same thing in the similar issue #25684, though that is marked for 2.7 and 3.5 also. |
|
Date |
User |
Action |
Args |
2017-01-31 21:34:54 | terry.reedy | set | recipients:
+ terry.reedy, serhiy.storchaka |
2017-01-31 21:34:54 | terry.reedy | set | messageid: <1485898494.74.0.656128703551.issue29402@psf.upfronthosting.co.za> |
2017-01-31 21:34:54 | terry.reedy | link | issue29402 messages |
2017-01-31 21:34:54 | terry.reedy | create | |
|