PyGObject
   HOME

TheInfoList



OR:

PyGTK is a set of
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (prog ...
wrappers for the
GTK GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both Free software, free and ...
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 ...
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 ...
. PyGTK is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
and licensed under the
LGPL The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
. It is analogous to
PyQt 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 ...
/
PySide 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 ...
and
wxPython wxPython is a wrapper for the cross-platform GUI API (often referred to as a "toolkit") wxWidgets (which is written in C++) for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension ...
, the Python wrappers for Qt and
wxWidgets wxWidgets (formerly wxWindows) is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with no s ...
, respectively. Its original author is
GNOME A gnome () is a mythological creature and diminutive spirit in Renaissance magic and alchemy, introduced by Paracelsus in the 16th century and widely adopted by authors, including those of modern fantasy literature. They are typically depict ...
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. PyGTK will be phased out with the transition to GTK version 3 and be replaced with PyGObject, which uses GObject Introspection to generate bindings for Python and other languages on the fly. This is expected to eliminate the delay between GTK updates and corresponding
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 ...
updates, as well as reduce maintenance burden on the developers.


Syntax

The Python code below will produce a 200x200 pixel window with the words "
Hello World Hello World may refer to: * "Hello, World!" program, a computer program that outputs or displays the message "Hello, World!" Music * "Hello World!" (composition), song by the Iamus computer * "Hello World" (Tremeloes song), 1969 * "Hello World" ...
" inside. import gtk def create_window(): window = gtk.Window() window.set_default_size(200, 200) window.connect("destroy", gtk.main_quit) label = gtk.Label("Hello World") window.add(label) label.show() window.show() create_window() gtk.main()


Notable applications that have used PyGTK

PyGTK has been used in a number of notable applications, some examples: * Anaconda installer *
BitTorrent BitTorrent is a Protocol (computing), communication protocol for peer-to-peer file sharing (P2P), which enables users to distribute data and electronic files over the Internet in a Decentralised system, decentralized manner. The protocol is d ...
*
Deluge A deluge is a large downpour of rain, often a flood. The Deluge refers to the flood narrative in the biblical book of Genesis. Deluge or Le Déluge may also refer to: History *Deluge (history), the Swedish and Russian invasion of the Polish-L ...
* Emesene *
Exaile Exaile is a cross-platform free and open-source audio player, tag editor and library organizer. It was originally conceived to be similar in style and functions to KDE's Amarok 1.4, but uses the GTK widget toolkit rather than Qt. It is writte ...
* Flumotion *
Gajim Gajim is an instant messaging client for the XMPP protocol which uses the GTK toolkit. The name Gajim is a recursive acronym for ''Gajim's a jabber instant messenger''. Gajim runs on Linux, BSD, macOS, and Microsoft Windows. Released under the ...
*
gDesklets gDesklets is a GNOME program which provides the architecture for small applets ( desktop widgets) to be placed on top of the user's desktop. It is comparable to other desktop widget programs. The applets placed on the desktop are meant to be q ...
*
Gedit gedit ( or ) is a text editor designed for the GNOME desktop environment. It was GNOME's default text editor and part of the GNOME Core Applications until GNOME version 42 in March 2022, which changed the default text editor to GNOME Text Edi ...
(for optional Python subsystem and plugins) *
GIMP Gimp or GIMP may refer to: Clothing * Bondage suit, also called a gimp suit, a type of suit used in BDSM * Bondage mask, also called a gimp mask, often worn in conjunction with a gimp suit Embroidery and crafts * Gimp (thread), an ornamental tr ...
(for optional Python scripts) * GNOME Sudoku *
Gramps Grandparents, individually known as grandmother and grandfather, or Grandma and Grandpa, are the parents of a person's father or mother – paternal or maternal. Every sexually reproducing living organism who is not a genetic chimera has a maxi ...
* Gwibber (microblogging client) *
Jokosher Jokosher was a free software, Non-linear editing system, non-linear Multitrack recording, multi-track digital audio editor, released under the GNU General Public License, GPL-2.0-only. It was written in Python (programming language), Python, usi ...
*
puddletag Puddletag is a graphical audio file metadata editor ("tagger") for Unix-like operating systems. It is free and open-source software subject to the terms of the GNU General Public License (GPL) version 3. In most major desktop Linux distributions, ...
* PyMusique * Pybliographer * Tryton *
ROX Desktop The ROX Desktop is a discontinued graphical desktop environment for the X Window System. It is based on the ROX-Filer, a drag and drop spatial file manager. It is free software released under the GPL-2.0-or-later. The environment was inspire ...
(includes ROX-Filer) * SoundConverter * Ubiquity (
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
installer) *
Ubuntu Software Center Ubuntu Software Center, or simply Software Center, is a discontinued high-level graphical front end for the APT/dpkg package management system. It is free software written in Python, PyGTK/PyGObject based on GTK. The program was created for ...
* Wing IDE * Comix


PyGObject

PyGObject provides a wrapper for use in Python programs when accessing GObject libraries.
GObject The GLib Object System, or GObject, is a free software, free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C (programming language), C programs ...
is an object system used by
GTK GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both Free software, free and ...
,
GLib GLib is a bundle of three (formerly five) low-level system libraries written in C and developed mainly by GNOME. GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since ...
,
GIO Gio or GIO may refer to: Science and technology * Gi/o, protein subunits * GIO, a computer bus * GIO (software), a library for accessing virtual file-systems * 11084 Giò, a main belt asteroid * Gibioctet, a unit of digital information * ...
,
GStreamer GStreamer is a Pipeline (computing), pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one f ...
and other libraries. Like the GObject library itself, PyGObject is licensed under the
GNU LGPL The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
, so it is suitable for use in both free software and proprietary applications. It is already in use in many applications ranging from small single-purpose scripts to large full-featured applications. PyGObject can dynamically access any GObject libraries that use GObject Introspection. It replaces the need for separate modules such as PyGTK, GIO and python-gnome to build a full GNOME 3.0 application. Once new functionality is added to GObject library it is instantly available as a Python API without the need for intermediate Python glue.


Notable applications that use PyGObject

PyGObject has replaced PyGTK, but it has taken a considerable amount of time for many programs to be ported. Most of the software listed here has an older version which used PyGTK. *
Gramps Grandparents, individually known as grandmother and grandfather, or Grandma and Grandpa, are the parents of a person's father or mother – paternal or maternal. Every sexually reproducing living organism who is not a genetic chimera has a maxi ...
* Meld * Pitivi *
PyChess ''PyChess'' is a free software chess client developed for GNU. It allows users to play offline or online via the Free Internet Chess Server (FICS). PyChess also incorporates a built-in chess engine, which in contrast to most other chess AIs is ...
* Quod Libet


See also

*
PyQt 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 ...
(Python wrapper for the Qt toolkit) *
PySide 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 ...
(Alternative Python wrapper for the Qt toolkit) *
wxPython wxPython is a wrapper for the cross-platform GUI API (often referred to as a "toolkit") wxWidgets (which is written in C++) for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension ...
(Python wrapper for the wx widgets collection)


References


External links


PyGTK Homepage

PyGTK FAQ



PyGTK Notebook A Journey Through Python Gnome Technologies by Peter Gill

PyGTK at Python wiki

PyGObject Homepage


{{Widget toolkits GTK language bindings Python (programming language) libraries Software that uses PyGObject Software that uses PyGTK Widget toolkits