A widget is available for users to interact with, allowing them to initiate specific actions upon clicking. When designing a button, you have the option to define various attributes, including the text displayed on its face and a callback function. The callback function refers to a designated function or method that triggers when the user clicks the button, commonly referred to as an event handler.
For Example,
destroy() method is the callback function. This means that when the user clicks the button, the destroy() method is invoked, resulting in the program's termination.
Output: