Gtkmm

Last updated
Repository
Written in C++
Platform GTK
Type Language binding
License GNU Lesser General Public License
Website www.gtkmm.org

gtkmm (formerly known as gtk-- or gtk minus minus [1] ) is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License (LGPL).

Contents

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.

Features

Because gtkmm is the official C++ interface of the GUI library GTK, C++ programmers can use the common OOP techniques such as inheritance, and C++-specific facilities such as STL (In fact, many of the gtkmm interfaces, especially those for widget containers, are designed to be similar to the Standard Template Library (STL)).

Main features of gtkmm are listed as follows:

Hello World in gtkmm

//HelloWorldWindow.h#ifndef HELLOWORLDWINDOW_H#define HELLOWORLDWINDOW_H#include<gtkmm/window.h>#include<gtkmm/button.h>// Derive a new window widget from an existing one.// This window will only contain a button labelled "Hello World"classHelloWorldWindow:publicGtk::Window{public:HelloWorldWindow();protected:Gtk::Buttonhello_world;};#endif
//HelloWorldWindow.cc#include<iostream>#include"HelloWorldWindow.h"HelloWorldWindow::HelloWorldWindow():hello_world("Hello World"){// Set the title of the window.set_title("Hello World");// Add the member button to the window,add(hello_world);// Handle the 'click' event.hello_world.signal_clicked().connect([](){std::cout<<"Hello world"<<std::endl;});// Display all the child widgets of the window.show_all_children();}
//main.cc#include<gtkmm/main.h>#include"HelloWorldWindow.h"intmain(intargc,char*argv[]){// InitializationGtk::Mainkit(argc,argv);// Create a hello world window objectHelloWorldWindowexample;// gtkmm main loopGtk::Main::run(example);return0;}

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-oexample`pkg-configgtkmm-3.0--cflags--libs`$ ./example 

This is usually done using a simple makefile.

Applications

Some notable applications that use gtkmm include:

See also

Related Research Articles

wxWidgets Widget toolkit

wxWidgets 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 minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

<span class="mw-page-title-main">Metacity</span> Window manager

Metacity was the default window manager used by the GNOME 2 desktop environment until it was replaced by Mutter in GNOME 3. It is still used by GNOME Flashback, a session for GNOME 3 that provides a similar user experience to the Gnome 2.x series sessions.

<span class="mw-page-title-main">FLTK</span>

Fast Light Toolkit is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

<span class="mw-page-title-main">Fox toolkit</span>

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.

Cairo (graphics) Vector graphics-based software library

Cairo is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers. It provides primitives for two-dimensional drawing across a number of different back ends. Cairo uses hardware acceleration when available.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

<span class="mw-page-title-main">PHP-GTK</span> PHP library for GTK+ GUI applications

PHP-GTK is a set of language bindings for the programming language PHP which allow GTK graphical user interface (GUI) applications to be written in PHP. PHP-GTK provides an object-oriented programming interface to GTK classes and functions. PHP-GTK partly supports GTK2, but GTK3 is unsupported.

In computer programming, an entry point is the place in a program where the execution of a program begins, and where the program has access to command line arguments.

<span class="mw-page-title-main">GParted</span> Partition editor

GParted is a GTK front-end to GNU Parted and an official GNOME partition-editing application. GParted is used for creating, deleting, resizing, moving, checking, and copying disk partitions and their file systems. This is useful for creating space for new operating systems, reorganizing disk usage, copying data residing on hard disks, and mirroring one partition with another. It can also be used to format a USB drive.

<span class="mw-page-title-main">Newt (programming library)</span>

Newt is a programming library for color text mode, widget-based user interfaces. Newt can be used to add stacked windows, entry widgets, checkboxes, radio buttons, labels, plain text fields, scrollbars, etc., to text user interfaces. This package also contains the shared library needed by programs built with newt, as well as a CLI application whiptail, which provides the most commonly used features of dialog. Newt is based on the slang library. It abbreviates from Not Erik's Windowing Toolkit.

<span class="mw-page-title-main">Vala (programming language)</span> Programming language

Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.

ReAction GUI is the widget toolkit engine that is used in AmigaOS 3.2-4.1.

java-gnome is a set of language bindings for the Java programming language for use in the GNOME desktop environment. It is part of the official GNOME language bindings suite and provides a set of libraries allowing developers to write computer programs for GNOME using the Java programming language and the GTK cross-platform widget toolkit.

<span class="mw-page-title-main">GTK</span> Free and open-source cross-platform widget toolkit for creating graphical user interfaces

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 proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

<span class="mw-page-title-main">GNOME</span> Desktop environment for Linux and other Unix-like systems

GNOME, originally an acronym for GNU Network Object Model Environment, is a free and open-source desktop environment for Linux and other Unix-like operating systems.

<span class="mw-page-title-main">PySide</span>

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 supports Linux/X11, macOS, and Microsoft Windows. The project can also be cross compiled to embedded systems like Raspberry Pi, and Android devices.

Wt is an open-source widget-centric web framework for the C++ programming language. It has an API resembling that of Qt framework, also using a widget-tree and an event-driven signal/slot system.

mpv (media player) Free and open-source media player software

mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, PowerPC, x86/IA-32, x86-64, and MIPS architecture.

References

  1. The gtkmm FAQ
  2. "Debian -- Details of package amsynth in jessie" . Retrieved 2017-03-06.
  3. "Debian -- Details of package cadabra in jessie" . Retrieved 2017-03-06.
  4. "Debian -- Details of package gnome-system-monitor in jessie" . Retrieved 2017-03-06.
  5. "Debian -- Details of package gigedit in jessie" . Retrieved 2017-03-06.
  6. "Debian -- Details of package pavucontrol in jessie" . Retrieved 2017-03-06.
  7. "Debian -- Details of package paman in jessie" . Retrieved 2017-03-06.
  8. "Debian -- Details of package paprefs in jessie" . Retrieved 2017-03-06.
  9. "Debian -- Details of package pavumeter in jessie" . Retrieved 2017-03-06.
  10. "Debian -- Details of package rawtherapee in jessie" . Retrieved 2017-03-06.
  11. "Debian -- Details of package seq24 in jessie" . Retrieved 2017-03-06.
  12. "Debian -- Details of package synfigstudio in jessie" . Retrieved 2017-03-06.
  13. "Debian -- Details of package linthesia in jessie" . Retrieved 2017-03-06.
  14. "Debian -- Details of package mysql-workbench in jessie" . Retrieved 2017-03-06.
  15. "Debian -- Details of package visualboyadvance-gtk in jessie" . Retrieved 2017-03-06.