I’m wondering how to add more information to an event embed in a button.
For example:
okButton = ttk.Button( content, text = 'OK' )
okButton.bind( "<Button-1>", browseFile )
def browseFile( event ):
pass
When the button clicked, I want to pass the string parameter ‘OK’ to the function browseFile, what I need to do?
Thanks
The
eventobject has awidgetmember that identifies the widget that raised the event. You can get the text of that widget using thecgetmethod: