from Tkinter import *
root = Tk()
v = IntVar()
v.set(0)
def click():
print "1"
class MyRadio(Radiobutton):
def __init__(self,root,variable,value):
self.variable = variable
self.value = value
Radiobutton.__init__(self,root,variable=variable,value=value,command=self.click)
def click(self):
print self.variable,'====',self.value
for i in range(3):
MyRadio(root,
variable = v,
value = i).pack()
root.mainloop()
Tkinter 继承
最新推荐文章于 2024-07-25 17:35:50 发布
751

被折叠的 条评论
为什么被折叠?



