Amtk Introduction

Amtk Introduction — Introduction to the Actions, Menus and Toolbars Kit for GTK+

Amtk is the acronym for “Actions, Menus and Toolbars Kit”. It is a basic GtkUIManager replacement based on GAction. GtkUIManager has been deprecated in GTK+ 3, without a good replacement for applications that want to keep a traditional UI (with a GtkMenuBar, a GtkToolbar and a GtkStatusbar; in contrast to the new UI with a GtkHeaderBar and a “hamburger menu”).

Amtk is developed inside the Tepl repository, but is a separate shared library so that applications can use it without depending on Tepl, GtkSourceView, etc.

With Amtk, menus and toolbars are created programmatically, but with convenient APIs (the support for an XML format will maybe be added in the future, contributions welcome). GMenu is not used, a menubar is created with GtkMenuItem's, although the support for GMenu could easily be added.

There are currently several things that are not possible to do with the support of GMenu in GTK+, that Amtk solves:

Sanity checks

Amtk has several functions to do various sanity checks. They normally don't impact too much the performances, so it is recommended to always run them, although they could be disabled on production. The functions:

GTK+ dependency

Amtk 3 depends on GTK+ 3.

pkg-config name

For Amtk 3, the pkg-config name is: amtk-3

To compile a program that uses Amtk 3, you can for example use the following command:

$ gcc hello.c `pkg-config --cflags --libs amtk-3` -o hello