Message362043
Using the bind method, the event will still trigger when the widget is disabled. However, if using "command=" it doesn't. Wondering whether the behaviour between the two ways of setting up event handling should behave the same? Not a major issue, easy enough to work around using an if.
Example:
Clicking the printBtn will still work despite being disabled.
self.printBtn = tkinter.Button(self.frame, text='Print')
self.printBtn['state'] = tkinter.DISABLED
self.printBtn.bind(sequence='<Button-1>', func=self.printBtn_onclick)
self.printBtn.pack()
Clicking on the save button, the event will not trigger (ie the disabled state attribute is honored)
self.saveBtn = tkinter.Button(self.frame, text='Save', command=self.saveBtn_onclick)
self.saveBtn['state'] = tkinter.DISABLED
self.saveBtn.pack() |
|
Date |
User |
Action |
Args |
2020-02-16 03:11:33 | mrshr3d | set | recipients:
+ mrshr3d |
2020-02-16 03:11:33 | mrshr3d | set | messageid: <1581822693.94.0.0781458615006.issue39642@roundup.psfhosted.org> |
2020-02-16 03:11:33 | mrshr3d | link | issue39642 messages |
2020-02-16 03:11:33 | mrshr3d | create | |
|