Python Tutorial

What Are Widgets in Tkinter in Python?

Different types of Widgets in Tkinter in Python

Tkinter supports many controls in a GUI program, such as buttons, labels, and text boxes. Widgets are the general name for these controls.
Tkinter presently has 15 different widget kinds. In the table below, we give these widgets together with a brief description.

1. Button: Used for showing buttons in the application.

2. Checkbutton: When there are a number of options to be shown as checkboxes, this widget is used. Users can choose more than one option.

3. Entry: To show users a single-line text field where they can enter asked values.

4. Frame: Used for the organization of other widgets. It is utilized as a container widget.

5. Canvas: To create different types of shapes, including lines, squares, rectangles, circles, etc.

6. Menubutton: To show menus in the application.

7. Menu: To show a number of different commands to the end-user, within the Menubutton. 

8. Label: This is used for adding a single-line caption to other widgets. You can also use a label widget for images.

9. Listbox: Using this widget, you can show a list of options.

10. Text: To show the text in multiple lines.

11. Scale: For adding a slider widget. 

12. Message: You can use it to accept comments or messages from the users by providing them a multiline text field. 

13. Radiobutton: It allows you to show the options in the form of radio buttons. At a time, the users are allowed to choose only one option. 

14. Scrollbar: For adding the scrolling functionality to other widgets.

15. LabelFrame: A container widget used as a spacer or container for complicated layouts.

16. Spinbox: A variant of the Entry widget used for choosing one option from the available number of values.

17. PanedWindow: Another container widget that includes several panes which are arranged in horizontal or vertical form. 

18. Toplevel: Used for offering a separate window container.

tkMessageBox: Used for showing message boxes.

Did you find this article helpful?