Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit,and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.
The name Tkinter comes from Tk interface. Tkinter was written by Steen Lumholt and Guido van Rossum,then later revised by Fredrik Lundh.
Tkinter is free software released under a Python license.
As with most other modern Tk bindings, Tkinter is implemented as a Python wrapper around a complete Tcl interpreter embedded in the Python interpreter. Tkinter calls are translated into Tcl commands, which are fed to this embedded interpreter, thus making it possible to mix Python and Tcl in a single application.
There are several popular GUI library alternatives available, such as Kivy, Pygame, Pyglet, PyGObject, PyQt, PySide, and wxPython.
This term has different meanings in different contexts, but in general it refers to a rectangular area somewhere on the user's display screen.
A window which acts as a child of the primary window. It will be decorated with the standard frame and controls for the desktop manager. It can be moved around the desktop and can usually be resized.
The generic term for any of the building blocks that make up an application in a graphical user interface.
In Tkinter, the Frame widget is the basic unit of organization for complex layouts. A frame is a rectangular area that can contain other widgets.
When any widget is created, a parent–child relationship is created. For example, if you place a text label inside a frame, the frame is the parent of the label.
Here is a minimal Python 3 Tkinter application with one widget:
#!/usr/bin/env python3fromtkinterimport*root=Tk()# Create the root (base) window w=Label(root,text="Hello, world!")# Create a label with wordsw.pack()# Put the label into the windowroot.mainloop()# Start the event loop
For Python 2, the only difference is the word "tkinter" in the import command will be capitalized to "Tkinter".
There are four stages to creating a widget
These are often compressed, and the order can vary.
Using the object-oriented paradigm in Python, a simple program would be (requires Tcl version 8.6, which is not used by Python on MacOS by default):
#!/usr/bin/env python3importtkinterastkclassApplication(tk.Frame):def__init__(self,root=None):tk.Frame.__init__(self,root)self.grid()self.createWidgets()defcreateWidgets(self):self.medialLabel=tk.Label(self,text='Hello World')self.medialLabel.config(bg="#00ffff")self.medialLabel.grid()self.quitButton=tk.Button(self,text='Quit',command=self.quit)self.quitButton.grid()app=Application()app.root.title('Sample application')app.mainloop()
Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an API for providing a graphical user interface (GUI) for Java programs.
Fast Light Toolkit is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.
A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.
PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS.
PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.
The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.
wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.
A tree view is a graphical widget within a graphical user interface (GUI) in which users can navigate and interact intuitively with concise, hierarchical data presented as nodes in a tree-like format. It can also be called an outline view.
Tkhtml is a discontinued open-source browser engine written in C using the Tk widget toolkit. It was used primarily by the Html Viewer 3 (Hv3) minimalist web browser.
Tk is a cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. It is free and open-source software released under a BSD-style software license.
ReAction GUI is the widget toolkit engine that is used in AmigaOS 3.2-4.1.
Zenity is free software and a cross-platform program that allows the execution of GTK dialog boxes in command-line and shell scripts.
PySide is a Python binding of the cross-platform GUI toolkit Qt developed by The Qt Company, as part of the Qt for Python project. It is one of the alternatives to the standard library package Tkinter. Like Qt, PySide is free software. PySide supports Linux/X11, macOS, and Microsoft Windows. The project can also be cross compiled to embedded systems like Raspberry Pi, and Android devices.
Veusz is a scientific plotting package. Veusz is a Qt application written in Python, PyQt and NumPy. It is freely available for anyone to distribute under the terms of the GPL. It is designed to produce publication-quality plots. The name should be pronounced as "views".
wxPHP stands for "wxWidgets for PHP" and is a PHP extension that wraps the wxWidgets library, which allows writing multi-platform desktop applications that make use of the native graphical components available to the different platforms. It supports the three major operating systems: Windows, Linux and Mac OS X by using the PHP language. Applications are written in PHP language, and since it is an interpreted language, it does not require an intermediate compilation step in order to run the application, provided the PHP interpreter has the extension available.
Kivy is a free and open source Python framework for developing mobile apps and other multitouch application software with a natural user interface (NUI). It is distributed under the terms of the MIT License, and can run on Android, iOS, Linux, macOS, and Windows.
Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful. Tcl casts everything into the mold of a command, even programming constructs like variable assignment and procedure definition. Tcl supports multiple programming paradigms, including object-oriented, imperative, functional, and procedural styles.
appJar is a cross-platform Python library for developing GUIs. It can run on Linux, OS X, and Windows. It was conceived, and continues to be developed with educational use as its focus, so is accompanied by comprehensive documentation, as well as easy-to-follow lessons.
Fyne is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs) across desktop and mobile platforms. Fyne uses OpenGL to provide cross-platform graphics. It is inspired by the principles of Material Design to create applications that look and behave consistently across all platforms. It is licensed under the terms of the 3-clause BSD License, supporting the creation of free and proprietary applications. In December 2019 Fyne became the most popular GUI toolkit for Go, by GitHub star count and in early February 2020 it was trending as #1 project in GitHub trending ranks.