How do I add a command to a button say for instance
class MYCLASNAME:
def choices(self):
choices = Toplevel()
v = IntVar()
a = Radiobutton(choices, text="Add News",
variable=v,value=1).pack(anchor=W)
b = Radiobutton(choices, text="Edit News",
variable=v,value=2).pack(anchor=W)
c = Radiobutton(choices, text="Delete News",
variable=v,value=3).pack(anchor=W)
d = Radiobutton(choices, text="Quit",
variable=v,value=4).pack(anchor=W)
button = Button(choices, text="Action?",command=self.V
(a,b,c,d)).pack(anchor=W)
choices.title("What are your actions?")
def V(self,a,b,c,d):
if a != "":
print a
elif b != "":
print b
elif c != "":
print c
elif d != "":
print d
else:
print "error";
button = Button(choices, text="Action?",command=self.V(a,b,c,d)).pack(anchor=W)
doesn't even do anything, what can I do to fix this problem?
--
http://mail.python.org/mailman/listinfo/python-list