HOME

TheInfoList



OR:

gtkmm (formerly known as gtk-- or gtk minus minus) is the official C++ interface for the popular GUI library GTK. 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, ...
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, using the Gtk::Builder class. Other features include typesafe callbacks, a comprehensive set of graphical control elements, and the extensibility of widgets via
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offici ...
.


Features

Because gtkmm is the official C++ interface of the GUI library GTK, C++ programmers can use the common
OOP OOP, Oop, or oop may refer to: Science and technology * Object-oriented positioning Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of ...
techniques such as
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offici ...
, and C++-specific facilities such as STL (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 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 called ''algorithms'', ''co ...
(STL)). Main features of gtkmm are listed as follows: * Use
inheritance Inheritance is the practice of receiving private property, titles, debts, entitlements, privileges, rights, and obligations upon the death of an individual. The rules of inheritance differ among societies and have changed over time. Offici ...
to derive custom widgets. * Type-safe signal handlers, in standard C++. *
Polymorphism Polymorphism, polymorphic, polymorph, polymorphous, or polymorphy may refer to: Computing * Polymorphism (computer science), the ability in programming to present the same programming interface for differing underlying forms * Ad hoc polymorphis ...
. * Use of Standard C++ Library, including strings,
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. * Full internationalization with
UTF-8 UTF-8 is a 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''. UTF-8 is capable of ...
. * Complete C++ 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 kin ...
. ** 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 i ...
( 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 repre ...
),
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 repre ...
),
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 ( 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 ...
),
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 ...
( 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 (computer), Mac computers. Within the market of ...
( 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 deve ...
.


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 The Minimoog is an analog synthesizer first manufactured by Moog Music between 1970 and 1981. Designed as a more affordable ...
* Cadabra (computer program) *
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. re ...
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 partiti ...
disk partitioning tool. * Nemiver 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 oper ...
tools: pavucontrol, paman, paprefs pavumeter, * RawTherapee * GNOME Referencer 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 Synfig Studio (also known as Synfig) is a free and open-source vector-based 2D animation software. It is created by Robert Quattlebaum with additional contributions by Adrian Bentley. Synfig began as the custom animation platform for Voria St ...
* Linthesia * MySQL Workbench Administrator Database GUI. * Ardour Open Source digital audio workstation (DAW) for Linux and MacOS. * Gnote desktop notetaking application. * VisualBoyAdvance * VMware Workstation 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 *
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 min ...
* FLTK * FOX toolkit * 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