Python Graphical user interface programming

Source: Internet
Author: User

1. Tcl, TK and Tkinter
Tkinter is the default GUI library for Python, which is based on the TK toolset, which was originally designed for the tool Command Language (TCL). Tk has been widely ported, including Perl (PERL/TK), Ruby (RUBY/TK), Python (Tkinter). TK develops the portability and flexibility of the GUI, the simplicity of the Python scripting language and the robustness of the system language. Python, based on TK, provides a more efficient and rapid prototyping system for creating applications. Python also has system access, network operations, XML, digital visualization, database access, and all other standard libraries and third-party modules.

2, Tkinter and Python programming
Tkinter Top-Level window objects, components (labels, buttons, list boxes, and so on)

The top=tkinter.tk () #创建顶层窗口对象, called the root window.
1

Multiple top-level windows can be created in the GUI, but they can have only one root window.
The parent component (container), subassembly component has events, callbacks, event-driven
TK has two coordinate managers: one is a package (packer), one is a grid (grids)
GUI programs are similar to client/server architectures, and there is a "server-style" infinite loop. This includes waiting for GUI events, handling events, and then returning to wait mode to handle the next event.
Tkinter.mainloop () All components are ready for the backward master loop. Once in the main loop, the GUI begins to master control, and other actions come from the callback function. Top-level window tkinter.tk () Tk component button, Canvas, Checkbutton, Entry, Frame, Label, Listbox, Menu, Menubutton, message, Radiobutton, Scale, Scrollbar, Text, TopLevel.

Partial function application (PFA)
The partial function allows you to "store" some of the function variables and effectively "freeze" these predetermined parameters, and then "thaw" them out with these final parameters to call the function at runtime, after you have obtained the other variables you need. PFA is not limited to functions, but is valid for anything "callable."

3, the introduction of other GUI
(1) Tk Interface eXtensions (tix)
TIX is an extension library for TCL/TK.
(2) Tkinter extension of Python Mega widgets (PMW)
PMW extended the Tkinter.
(3) WxWidgets and WxPython
(4) GTK + and PyGTK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.