A widget toolkit, widget library, GUI toolkit, or UX library is a
library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
or a collection of libraries containing a set of
graphical control elements (called ''widgets'') used to construct the
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
(GUI) of programs.
Most widget toolkits additionally include their own
rendering engine. This engine can be specific to a certain
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
or
windowing system or contain back-ends to interface with multiple ones and also with rendering APIs such as
OpenGL
OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
,
OpenVG
OpenVG is an API designed for hardware-accelerated 2D vector graphics. Its primary platforms are mobile phones, gaming & media consoles and consumer electronic devices. It was designed to help manufacturers create more attractive user interfac ...
, or
EGL.
The
look and feel
In software design, the look and feel of a graphical user interface comprises aspects of its design, including elements such as colors, shapes, layout, and typefaces (the "look"), as well as the behavior of dynamic elements such as buttons, boxes ...
of the graphical control elements can be hard-coded or decoupled, allowing the graphical control elements to be
themed/
skinned.
Overview

Some toolkits may be used from other languages by employing
language binding
In programming and software design, a binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to ...
s.
Graphical user interface builder
A graphical user interface builder (or GUI builder), also known as GUI designer or sometimes RAD IDE, is a software development tool that simplifies the creation of GUIs by allowing the designer to arrange graphical control elements (often cal ...
s such as e.g.
Glade Interface Designer facilitate the authoring of GUIs in a
WYSIWYG
In computing, WYSIWYG ( ), an acronym for what you see is what you get, refers to software that allows content to be edited in a form that resembles its appearance when printed or displayed as a finished product, such as a printed document, web ...
manner employing a
user interface markup language
A user interface markup language is a markup language that renders and describes graphical user interfaces and controls. Many of these markup languages are dialects of XML and are dependent upon a pre-existing scripting language engine, usually a ...
such as in this case
GtkBuilder.
The GUI of a program is commonly constructed in a cascading manner, with graphical control elements being added directly to on top of one another.
Most widget toolkits use
event-driven programming
In computer programming, event-driven programming is a programming paradigm in which the Control flow, flow of the program is determined by external Event (computing), events. User interface, UI events from computer mouse, mice, computer keyboard, ...
as a model for interaction.
Past, Present and Future of User Interface Software Tools
Brad Myers, Scott E. Hudson, Randy Pausch, Y Pausch. ACM Transactions on Computer-Human Interaction, 2000
/ref> The toolkit handles Event handler, user events, for example when the user clicks on a button
A button is a fastener that joins two pieces of fabric together by slipping through a loop or by sliding through a buttonhole.
In modern clothing and fashion design, buttons are commonly made of plastic but also may be made of metal, wood, or ...
. When an event is detected, it is passed on to the application where it is dealt with. The design of those toolkits has been criticized for promoting an oversimplified model of event-action, leading programmers to create error-prone, difficult to extend and excessively complex application code
This glossary of computer science is a list of definitions of terms and concepts used in computer science, its sub-disciplines, and related fields, including terms relevant to software, data science, and .
A
...
. Finite-state machine
A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
s and hierarchical state machines have been proposed as high-level models to represent the interactive state changes for reactive programs.
Windowing systems
A window
A window is an opening in a wall, door, roof, or vehicle that allows the exchange of light and may also allow the passage of sound and sometimes air. Modern windows are usually glazed or covered in some other transparent or translucent ma ...
is considered to be a graphical control element. In some windowing systems, windows are added directly to the scene graph (canvas) by the window manager
A window manager is system software that controls the placement and appearance of window (computing), windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They ...
, and can be stacked and layered on top of each other through various means. Each window is associated with a particular application which controls the widgets added to its canvas, which can be watched and modified by their associated applications.
See also
* WIMP (computing)
In human–computer interaction, WIMP stands for "window (computing), windows, icon (computing), icons, menu (computing), menus, Pointer (user interface), pointer", denoting a style of interaction using List of graphical user interface elements, ...
* Layout manager Layout managers are software components used in widget toolkits which have the ability to lay out graphical control elements by their relative positions without using distance units. It is often more natural to define component layouts in this mann ...
* List of widget toolkits
This article provides a list of widget toolkits (also known as GUI frameworks), used to construct the graphical user interface (GUI) of programs, organized by their relationships with various operating systems.
Low-level widget toolkits
Integrat ...
References
{{X desktop environments and window managers
Graphical user interfaces