Tkinter is Python's most popular Graphical User Interface (GUI) library. This topic explains the proper use of this library and its resources.
The tkinter package (“Tk interface”) is the standard Python interface for the Tk GUI toolkit. Tk and tkinter are available on most Unix platforms, as well as on Windows systems.
With Tkinter, you can easily create desktop applications using python quickly and it is good for prototyping your applications.
Python Tkinter - Tkinter widgets
Tkinter provides several controls, such as buttons, labels and text boxes used in a GUI application. These controls are commonly called widgets.
There are currently 15 types of widgets on Tkinter. We present these widgets, as well as a brief description in the following table.
Button : The Button widget is used to display buttons in your application.
Canvas : The widget is used to draw shapes, such as lines, ovals, polygons and rectangles, in your application.
Checkbutton : The Check Button widget is used to display various options as check boxes. The user can select several options at the same time.
Entry :The widget is used to display a single line text field to accept values from a user.
Frame : The widget is used as a container widget to organize other widgets.
Label : The widget is used to provide a single line caption for other widgets. It can also contain images. Listbox : The List Box widget is used to provide a list of options for a user.
Menubutton : The widget is used to display menus in your application.
Menu : The menu widget is used to provide various commands to a user. These commands are contained in Menubutton.
Message : The widget is used to display multiline text fields to accept values from a user.
Radiobutton : The widget is used to display various options as radio buttons. The user can select only one option at a time.
Scale : The widget is used to provide a sliding widget.
Scrollbar : The widget is used to add scrollability to multiple widgets, such as list boxes.
Text : The widget is used to display text on multiple lines.
Toplevel : The top-level widget is used to provide a separate window container.
Spinbox : The widget is a variant of the standard Tkinter Entry widget, which can be used to select a fixed number of values.
PanedWindow : A PanedWindow is a container widget that can contain any number of panels, arranged horizontally or vertically.
LabelFrame : A labelframe is a simple container widget. Its main objective is to act as a spacer or container for complex window layouts.
tkMessageBox: This module is used to display message boxes in your applications.
Python Tkinter - Default attributes
Let's take a look at how some of your common attributes are specified, such as sizes, colors and fonts.
- Dimensions
- Colors
- Fonts
- Anchors
- Relief styles
- Bitmaps
- Cursors
Post a Comment
0Comments