- Widget: Elements the make up the GUI
- Invisible container widgets (e.g. Frame)
- Visible interactive widgets (e.g. Button)
- Layout: Organizing widgets on GUI to specific positions
- Event: Objects that are generated for user or system actions, such as mouse click
Tkinter provides 18 built-in widget implementations.
- Button
- Canvas
- Entry
- Scrollbar
- Frame
Code: 00_hello_tkinter.py
- Initialization: Create Tk root which is a window
- One root per application
- It should be created before anything else
Code: 01_button_widget.py
- Used for adding buttons in a Python application
- Can display text or images
- You can attach a function or a method to a button which is called automatically when the button is clicked
Code: 02_checkbutton_widget.py
- Provides a checkbox with a text label
- Has two states: on and off
- Denotes a boolean property (True and False)
Code: 03_label_widget.py
- Used to display text tor images
- No user interaction
Code: 04_listbox_widget.py
- Displays a list of entries
- Allows selecting one or multiple items
### Entry Widget
Code: 05_entry_widget.py
- Used to accept single-line text from a user
- Use the Label widget if
- You want to display one or more lines of text that cannot be modified by the user
- Use Text widget if:
- You want to display multiple lines of text that can be edited
Code: 06_text_widget.py
- Provides formatted text display
- Allow you to display and edit text with various styles and attributes
- Supports embedded images and windows