[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:55:25 -0400 (EDT) |
branch: master
commit 587a878440b753ae1018a83ebcf7088d1ec22e4f
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Oct 22 12:49:33 2019 +0100
implement help message
---
js/infog/main.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/js/infog/main.c b/js/infog/main.c
index d516552e6f..3ccfcbad6e 100644
--- a/js/infog/main.c
+++ b/js/infog/main.c
@@ -626,6 +626,29 @@ back_clicked_cb (GtkButton *button, gpointer user_data)
webkit_web_view_go_back (webView);
}
+void
+help_clicked_cb (GtkButton *button, gpointer user_data)
+{
+ char *help_string =
+ "Summary of key commands\n"
+ "\n"
+ "n\tnext node\n"
+ "p\tprevious node\n"
+ "u\tgo up to parent node\n"
+ "i\tindex search\n"
+ "q\tquit"
+ ;
+
+ GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
+ GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(main_window),
+ flags,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ "%s", help_string);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+
void
build_gui (void)
{
@@ -647,6 +670,8 @@ build_gui (void)
gtk_header_bar_pack_start (header_bar, back_button);
help_button = gtk_button_new_with_mnemonic ("_Help");
+ g_signal_connect (help_button, "clicked",
+ G_CALLBACK(help_clicked_cb), NULL);
gtk_header_bar_pack_start (header_bar, help_button);
GtkBox *box = GTK_BOX(gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20