Gtkmm
   HOME

TheInfoList



OR:

gtkmm (formerly known as gtk-- or gtk minus minus) is the official
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
interface for the popular
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
library
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source 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 and propriet ...
. gtkmm is
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
distributed under the
GNU Lesser General Public License 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 ...
(LGPL). gtkmm allows the creation of user interfaces either in code or with the
Glade Interface Designer Glade Interface Designer is a graphical user interface builder for GTK, with additional components for GNOME. In its third version, Glade is programming language–independent, and does not produce code for events, but rather an XML fil ...
, using the Gtk::Builder class. Other features include typesafe
callback Callback may refer to: * Callback (comedy), a joke which refers to one previously told * Callback (computer programming), executable code that is passed as a parameter to other code * Callback (telecommunications), the telecommunications event tha ...
s, a comprehensive set of graphical control elements, and the extensibility of widgets via
inheritance Inheritance is the practice of receiving private property, Title (property), titles, debts, entitlements, Privilege (law), privileges, rights, and Law of obligations, obligations upon the death of an individual. The rules of inheritance differ ...
.


Features

Because gtkmm is the official
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
interface of the
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
library
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source 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 and propriet ...
,
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
programmers can use the common OOP techniques such as
inheritance Inheritance is the practice of receiving private property, Title (property), titles, debts, entitlements, Privilege (law), privileges, rights, and Law of obligations, obligations upon the death of an individual. The rules of inheritance differ ...
, and
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
-specific facilities such as
STL STL may refer to: Communications * Standard telegraph level *Studio/transmitter link International law *Special Tribunal for Lebanon The Special Tribunal for Lebanon (STL), also referred to as the Lebanon Tribunal or the Hariri Tribunal, is a ...
(In fact, many of the gtkmm interfaces, especially those for widget
containers A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping. Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
, are designed to be similar to the
Standard Template Library The Standard Template Library (STL) is a Library (computer science), software library originally designed by Alexander Stepanov for the C++ programming language that influenced many parts of the C++ Standard Library. It provides four components ...
(STL)). Main features of gtkmm are listed as follows: * Use
inheritance Inheritance is the practice of receiving private property, Title (property), titles, debts, entitlements, Privilege (law), privileges, rights, and Law of obligations, obligations upon the death of an individual. The rules of inheritance differ ...
to derive custom widgets. * Type-safe signal handlers, in standard
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
. * Polymorphism. * Use of Standard C++ Library, including
strings String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
,
containers A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping. Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
, and
iterators In computer programming, an iterator is an object that enables a programmer to traverse a container, particularly lists. Various types of iterators are often provided via a container's interface. Though the interface and semantics of a given iterat ...
. * Full internationalization with
UTF-8 UTF-8 is a variable-width encoding, variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit'' ...
. * Complete
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
memory management. **
Object composition In computer science, object composition and object aggregation are closely related ways to combine objects or data types into more complex ones. In conversation the distinction between composition and aggregation is often ignored. Common kind ...
. ** Automatic de-allocation of dynamically allocated widgets. * Full use of C++ namespaces. * No macros. * Cross-platform:
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
( gcc,
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate represen ...
),
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
( gcc,
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate represen ...
),
NetBSD NetBSD is a free and open-source Unix operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was forked. It continues to be actively developed and is a ...
( gcc),
Solaris Solaris may refer to: Arts and entertainment Literature, television and film * ''Solaris'' (novel), a 1961 science fiction novel by Stanisław Lem ** ''Solaris'' (1968 film), directed by Boris Nirenburg ** ''Solaris'' (1972 film), directed by ...
( gcc,
Forte Forte or Forté may refer to: Music *Forte (music), a musical dynamic meaning "loudly" or "strong" *Forte number, an ordering given to every pitch class set *Forte (notation program), a suite of musical score notation programs *Forte (vocal gro ...
),
Win32 The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
( gcc, MSVC++),
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
( gcc), others.


Hello World in gtkmm

//HelloWorldWindow.h #ifndef HELLOWORLDWINDOW_H #define HELLOWORLDWINDOW_H #include #include // Derive a new window widget from an existing one. // This window will only contain a button labelled "Hello World" class HelloWorldWindow : public Gtk::Window ; #endif //HelloWorldWindow.cc #include #include "HelloWorldWindow.h" HelloWorldWindow::HelloWorldWindow() : hello_world("Hello World") //main.cc #include #include "HelloWorldWindow.h" int main(int argc, char *argv[]) The above program will create a window with a button labeled "Hello World". The button sends "Hello world" to standard output when clicked. The program is run using the following commands: $ g++ -std=c++11 *.cc -o example `pkg-config gtkmm-3.0 --cflags --libs` $ ./example This is usually done using a simple
makefile In software development, Make is a build automation tool that automatically builds executable programs and libraries from source code by reading files called ''Makefiles'' which specify how to derive the target program. Though integrated develo ...
.


Applications

Some notable applications that use gtkmm include: *
Amsynth amsynth is an open source realtime software synthesizer for Linux. Its operation is similar to analog Moog Minimoog and Roland Juno-60, which are considered classic synthesizers from the 1970s. The two main oscillators support five cyclic w ...
*
Cadabra (computer program) Cadabra is a computer algebra system designed specifically for the solution of problems encountered in classical field theory, quantum field theory and string theory. The first version of Cadabra was developed around 2001 for computing higher- ...
*
Inkscape Inkscape is a free and open-source vector graphics editor used to create vector images, primarily in Scalable Vector Graphics (SVG) format. Other formats can be imported and exported. Inkscape can render primitive vector shapes (e.g. rectang ...
Vector graphics drawing.
Horizon EDA
an Electronic Design Automation package for printed circuit board design.
PDF Slicer
A simple application to extract, merge, rotate and reorder pages of PDF documents. * Workrave Assists in recovery and prevention of RSI. * Gnome System Monitor *
Gigedit LinuxSampler is music sampler software under active development , aiming to provide a pure software audio sampler with professional grade features comparable to both hardware and commercial software samplers, as well as to introduce new features ...
*
GParted GParted (acronym of GNOME Partition Editor) is a GTK front-end to GNU Parted and an official GNOME partition-editing application (alongside Disks). GParted is used for creating, deleting, resizing, moving, checking, and copying disk partitions ...
disk partitioning tool. *
Nemiver Nemiver is computer software, a graphical standalone debugger for the programming languages C and C++, which integrates in the GNOME desktop environment. It currently features a backend which uses the well known GNU Debugger (GDB). The creator ...
GUI for the GNU debugger gdb. *
PulseAudio PulseAudio is a network-capable sound server program distributed via the freedesktop.org project. It runs mainly on Linux, various BSD distributions such as FreeBSD and OpenBSD, macOS, as well as Illumos distributions and the Solaris operating ...
tools: pavucontrol, paman, paprefs pavumeter, *
RawTherapee RawTherapee is application software for processing photographs in raw image formats, as created by many digital cameras. It comprises a subset of image editing operations specifically aimed at non-destructive post-production of raw photos and is ...
* GNOME
Referencer Referencer is a GNOME application to organize documents or references, and ultimately generate a BibTeX bibliography file. It is designed with the scientist/researcher in mind, and "document" may be taken to mean "paper" in general, although Ref ...
document organiser and bibliography manager *
Seq24 Seq24 is a software MIDI music sequencer that runs under Linux and Microsoft Windows. Written in C++, it is designed to be simple to use and appropriate for live performance. Distributed under the terms of the GPL-2.0-or-later license, Seq24 is ...
* Synfig Studio * Linthesia *
MySQL Workbench MySQL Workbench is a visual database design tool that integrates SQL development, administration, database design, creation and maintenance into a single integrated development environment for the MySQL database system. It is the successor t ...
Administrator Database GUI. * Ardour Open Source digital audio workstation (DAW) for Linux and MacOS. *
Gnote Gnote is a free and open-source desktop note-taking application written for Linux, cloned by Hubert Figuière from Tomboy. It uses a Wiki-like linking system to connect notes together. Gnote is part of the GNOME desktop environment, often fill ...
desktop notetaking application. *
VisualBoyAdvance VisualBoyAdvance (commonly abbreviated as VBA) is a free emulator of the Game Boy, Game Boy Color, and Game Boy Advance handheld game consoles as well as of Super Game Boy and Super Game Boy 2. Besides the DirectX version for the Windows pl ...
*
VMware Workstation VMware Workstation Pro (known as VMware Workstation until release of VMware Workstation 12 in 2015) is a hosted (Type 2) hypervisor that runs on x64 versions of Windows and Linux operating systemshttps://kb.vmware.com/selfservice/microsites/sear ...
and
VMware Player VMware Workstation Player, formerly VMware Player, is a virtualization software package for x64 computers running Microsoft Windows or Linux, supplied free of charge by VMware, Inc., Archived version; the page as of 2016 is about VMware Workstat ...
both use gtkmm for their Linux ports.


See also

*
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source 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 and propriet ...
*
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 mini ...
* FLTK *
FOX toolkit 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. It features a hard-wired Windows 95-style theme available fo ...
* Qt * VCF


References


External links

* * {{GTK Articles with example C++ code C++ libraries Free computer libraries Free software programmed in C++ GTK language bindings Software using the LGPL license