|
9.
|
|
|
Set up help
|
|
|
(itstool) path: links/title
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:28 C/dev-help-build.page:28 C/dev-help.page:33
C/dev-help-write.page:23
|
|
10.
|
|
|
Most GNOME applications should have an application menu. The <gui style="menuitem">Help</gui> menu item should go above the <gui style="menuitem">About</gui> menu item.
|
|
|
(itstool) path: page/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:31
|
|
11.
|
|
|
This example, based on <app href="https://gitlab.gnome.org/GNOME/cheese/blob/master/src/cheese-main.vala">Cheese</app>, assumes that your application is written in Vala. It will be slightly different for other programming languages.
|
|
|
(itstool) path: note/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:37
|
|
12.
|
|
|
Add the <gui style="menuitem">Help</gui> item to the list of actions:
|
|
|
(itstool) path: example/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:43
|
|
13.
|
|
|
private const GLib.ActionEntry action_entries[] = {
<input>{ "help", on_help },</input>
{ "about", on_about },
{ "quit", on_quit }
};
add_action_entries (action_entries, my_Gtk_Application);
|
|
|
(itstool) path: example/code
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:44
|
|
14.
|
|
|
Add the <gui style="menuitem">Help</gui> menu item to the application menu:
|
|
|
(itstool) path: example/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:54
|
|
15.
|
|
|
var menu = new GLib.Menu ();
var section = new GLib.Menu ();
<input>var item = new GLib.MenuItem (_("_Help"), "app.help");
item.set_attribute ("accel", "s", "F1");
section.append_item (item);</input>
|
|
|
(itstool) path: example/code
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:57
|
|
16.
|
|
|
View the help with <app>Yelp</app> when the <gui style="menuitem">Help</gui> menu item is clicked:
|
|
|
(itstool) path: example/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:66
|
|
17.
|
|
|
private void on_help ()
{
var screen = main_window.get_screen ();
try
{
Gtk.show_uri (screen, <input>"help:cheese"</input>, Gtk.get_current_event_time ());
}
catch (Error err)
{
message ("Error opening help: %s", err.message);
}
}
|
|
|
(itstool) path: example/code
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:69
|
|
18.
|
|
|
To link to a section on the <file>index.page</file>, use <code>"help:<input>applicationname</input>/index#<input>sectionid</input>"</code>.
|
|
|
(itstool) path: example/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/dev-help-appmenu.page:84
|