Radina Matic
radina.matic@gmail.com 2013
Ekaterina Gerasimova
kittykat3756@gmail.com 2013
Fran Diéguez
frandieguez@gnome.org 2009-2020.
Leandro Regueiro
leandro.regueiro@gmail.com 2011.

# Add Help to the application menu

# Set up help

Most GNOME applications should have an application menu. The Help menu item should go above the About menu item.

This example, based on Cheese, assumes that your application is written in Vala. It will be slightly different for other programming languages.

Add the Help item to the list of actions:

private const GLib.ActionEntry action_entries[] = { { "help", on_help }, { "about", on_about }, { "quit", on_quit } };

add_action_entries (action_entries, my_Gtk_Application);

Add the Help menu item to the application menu:

var menu = new GLib.Menu (); var section = new GLib.Menu ();

var item = new GLib.MenuItem (_("_Help"), "app.help"); item.set_attribute ("accel", "s", "F1"); section.append_item (item);

View the help with Yelp when the Help menu item is clicked:

private void on_help () { var screen = main_window.get_screen (); try { Gtk.show_uri (screen, "help:cheese", Gtk.get_current_event_time ()); } catch (Error err) { message ("Error opening help: %s", err.message); } }

To link to a section on the index.page, use `"help:applicationname/index#sectionid"`.