This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrshr3d
Recipients mrshr3d
Date 2020-02-16.03:11:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581822693.94.0.0781458615006.issue39642@roundup.psfhosted.org>
In-reply-to
Content
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()
History
Date User Action Args
2020-02-16 03:11:33mrshr3dsetrecipients: + mrshr3d
2020-02-16 03:11:33mrshr3dsetmessageid: <1581822693.94.0.0781458615006.issue39642@roundup.psfhosted.org>
2020-02-16 03:11:33mrshr3dlinkissue39642 messages
2020-02-16 03:11:33mrshr3dcreate