summaryrefslogtreecommitdiff
path: root/app/wlib/gtklib/help.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/wlib/gtklib/help.c')
-rw-r--r--app/wlib/gtklib/help.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/wlib/gtklib/help.c b/app/wlib/gtklib/help.c
index dbb69f6..8f2766d 100644
--- a/app/wlib/gtklib/help.c
+++ b/app/wlib/gtklib/help.c
@@ -28,9 +28,12 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include "misc.h"
+
#include "gtkint.h"
#include "i18n.h"
+
/**
* Handle the commands issued from the Help drop-down. Currently, we only have a table
* of contents, but search etc. might be added in the future.
@@ -44,11 +47,19 @@ DoHelpMenu(void *data)
{
int func = (intptr_t)data;
+ const char * topic;
+
switch (func) {
case 1:
wHelp("index");
break;
+ case 3:
+ topic = GetCurCommandName();
+ if (topic && topic[0])
+ wHelp(topic);
+ break;
+
default:
break;
}
@@ -56,6 +67,10 @@ DoHelpMenu(void *data)
return;
}
+void wDoAccelHelp(wAccelKey_e key, void * context) {
+ DoHelpMenu(context);
+}
+
/**
* Add the entries for Help to the drop-down.
*
@@ -66,4 +81,5 @@ DoHelpMenu(void *data)
void wMenuAddHelp(wMenu_p m)
{
wMenuPushCreate(m, NULL, _("&Contents"), 0, DoHelpMenu, (void*)1);
+ wMenuPushCreate(m, NULL, _("Co&mmand Context help"), 0, DoHelpMenu, (void*)3);
}