Message166494
| Author |
crickert |
| Recipients |
asvetlov, crickert, gpolo, klappnase, mark, roger.serwy, terry.reedy |
| Date |
2012年07月26日.16:53:25 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1343321605.83.0.417677588114.issue15133@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Noticed this odd behaviour with BooleanVar.get() as well:
class MyCheckbutton(Checkbutton):
def __init__(self, parent, **options):
Checkbutton.__init__(self, parent, **options)
self.var = BooleanVar()
self.configure(indicatoron=False, command=self.cb, variable=self.var)
print(self.var.get) # "<bound method BooleanVar.get of <tkinter.BooleanVar object at 0x245c310>>"
print(self.var.get()) # "0"
def cb(self, *events): # button callback (manual toggle)
print(self.var.get) # <bound method BooleanVar.get of <tkinter.BooleanVar object at 0x245c310>>
print(self.var.get()) # True
Python 3.2.3 (default, May 3 2012, 15:51:42)
[GCC 4.6.3] on linux2 |
|