eVENT hANDLERS
eVENT hANDLERS
WHAT IS GUI
PROGRAMMING?
GUI (Graphical User Interface) programming involves designing
and developing user interfaces that allow users to interact with
software through graphical elements like windows, buttons,
and icons. Unlike command-line interfaces, GUIs are designed to
be more user-friendly and intuitive.
KEY COMPONENTS OF A GUI
Windows: Rectangular areas on the screen that display
content and allow interaction.
Buttons: Clickable elements that perform actions when
pressed.
Labels: Text elements used to display information.
Text Fields: Input areas where users can type information.
Menus: Navigational components that provide options for
user actions.
Dialogs: Pop-up windows that request user input or display
information.
GUI FRAMEWORKS AND
TOOLKITS
Tkinter (Python): The standard GUI toolkit for Python,
providing a simple way to create windows, dialogs, and
other GUI elements.
WIDGETS
Individual elements in the GUI, such as buttons, labels, and
text fields, that users interact with.
HOW TO DESIGN AN
EFFECTIVE UI
Effective GUI design focuses on usability and aesthetics:
or use the .bind() method in order to do so. Using this will be better in
the long run as it allows you access to the event object
HOW TO ASSOCIATE/BIND EVENT HANDLERS
This listens for mouse inputs and returns the location or
“coordinates” of the mouse to the console when clicking the button
HOW TO ASSOCIATE/BIND EVENT HANDLERS
This one listens for keyboard inputs and prints the key pressed in the
console. Note that this binds the event handler to the main window
itself