Repository | |
---|---|
Written in | C++ |
Platform | GTK |
Type | Language binding |
License | GNU Lesser General Public License |
Website | www |
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).
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.
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:
//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.
Some notable applications that use gtkmm include:
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.
Fast Light Toolkit (FLTK) 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.
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 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 backends. Cairo uses hardware acceleration when available.
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.
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.
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.
Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.
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.
Hildon is an application framework originally developed for mobile devices running the Linux operating system as well as the Symbian operating system. The Symbian variant of Hildon was discontinued with the cancellation of Series 90. It was developed by Nokia for the Maemo operating system. It focuses on providing a finger-friendly interface. It is primarily a set of GTK extensions that provide mobile-device–oriented functionality, but also provides a desktop environment that includes a task navigator for opening and switching between programs, a control panel for user settings, and status bar, task bar and home applets. It is standard on the Maemo platform used by the Nokia Internet Tablets and the Nokia N900 smartphone.
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 and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.
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.
Getopt is a C library function used to parse command-line options of the Unix/POSIX style. It is a part of the POSIX specification, and is universal to Unix-like systems. It is also the name of a Unix program for parsing command line arguments in shell scripts.
Seed is a JavaScript interpreter and a library of the GNOME project to create standalone applications in JavaScript. It uses the JavaScript engine JavaScriptCore of the WebKit project. It is possible to easily create modules in C.
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, MIPS, PowerPC, RISC-V, s390x, x86/IA-32, x86-64, and some other by 3rd party.