Tkinter is a Pythonbinding to the TkGUI 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 Mac OS X installs of Python. The name Tkinter comes from Tk interface. Tkinter was written by Fredrik Lundh. Tkinter is free software released under a Python license.
Description
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 wxPython, PyQt, PySide, Pygame, Pyglet, and PyGTK.
This term has different meanings in different contexts, but in general it refers to a rectangular area somewhere on the user's display screen.
Top Level Window
A window that exists independently on the screen. 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.
Core widgets: The containers: frame, labelframe, toplevel, paned window. The buttons: button, radiobutton, checkbutton, and menubutton. The text widgets: label, message, text. The entry widgets: scale, scrollbar, listbox, slider, spinbox, entry, optionmenu, text, and canvas.
Tkinter provides three modules that allow pop-up dialogs to be displayed: tk.messagebox, tk.filedialog and tk.colorchooser.
Python 2.7 and Python 3.1 incorporate the "themed Tk" functionality of Tk 8.5. This allows Tk widgets to be easily themed to look like the native desktop environment in which the application is running, thereby addressing a long-standing criticism of Tk. Some widgets are exclusive to ttk, such as the combobox, progressbar and treeview widgets
Frame
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.
Child and parent
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.
A minimal application
Here is a minimal Python 3 Tkinter application with one widget:
!/usr/bin/env python3
from tkinter import * root = Tk # Create the root window w = Label # Create a label with words w.pack # Put the label into the window root.mainloop # Start the event loop
Process
There are four stages to creating a widget ;Create :create it within a frame ;Configure :change the widgets attributes ;Pack : pack it into position so it becomes visible ;Bind :bind it to a function or event. These are often compressed and the order can vary.