gtkmm
gtkmm
|
|
---|---|
Basic data
|
|
developer | Murray Cumming, Daniel Elstner |
Current version | 3.22.1 (June 23, 2017) 2.24.5 (September 4, 2016) |
operating system | Unix , Linux , Microsoft Windows |
programming language | C ++ |
category | GUI toolkit |
License | LGPL ( Free Software ) |
German speaking | Yes |
gtkmm.org |
gtkmm is the C ++ interface for the free GUI toolkit GTK . The term gtkmm stands for gtk-- (gtk minus minus), the original name of the project.
The gtkmm library is under the free LGPL license and is therefore a free solution for graphical closed source programs under Linux and Unix.
Changes compared to Gtk
Among other things, the library encapsulates the GObject system in a functionally identical C ++ class hierarchy . In the C ++ variant of GLib , glibmm, the functions and structures are largely replaced by equivalents from the C ++ standard library .
Type-safe callback functions ( signal slot concept ) are implemented by gtkmm via the libsigc ++ library .
Programming example
The following example creates a window with a label area ( Label ) and a button ( Button ). The latter is using the libsigc ++ with the quit - function connected, so that the program at a click of the button is terminated. The two widgets are then placed in a typical Gtk container, a vertical box. This box will eventually appear in the window.
#include <gtkmm.h>
using namespace Gtk;
int main(int argc, char *argv[]) {
Main kit(argc, argv);
Window window;
window.set_title("Beispiel");
window.set_border_width(15);
Label hello("Hallo Welt!");
Button quit_button(Stock::QUIT);
quit_button.signal_clicked().connect(sigc::ptr_fun(&Gtk::Main::quit));
VBox box(false, 15);
box.add(hello);
box.add(quit_button);
window.add(box);
window.show_all();
Main::run(window);
return 0;
}
User interfaces can either be programmed explicitly with gtkmm or, like Gtk interfaces, created using the Glade program .
use
Programs written in gtkmm run on all platforms on which Gtk + also runs (including macOS and Windows ), whereby the toolkit is not primarily intended for cross-platform development, but is based in the area of Unix derivatives (such as Linux ).
Currently gtkmm 4 is being developed based on GTK + 4.
A popular application that uses gtkmm is Inkscape .
Alternatives
The range of functions of the gtkmm library is roughly comparable to that of the somewhat better-known Qt library . Unlike Qt, however, it does not contain any functions that go beyond GUI programming.
Comparable graphic libraries written in C ++ are also wxWidgets with a similar range of functions . FLTK is considerably less in scope.
See also
Web links
-
gtkmm project homepage
- Official tutorial (mixed German and English)
- Tutorial (offline version also available)
- German GTKmm tutorial in four parts