]> granicus.if.org Git - nethack/commitdiff
Enable scroll bar in X11 menu windows
authorPasi Kallinen <paxed@alt.org>
Fri, 1 Jan 2016 19:24:55 +0000 (21:24 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 1 Jan 2016 19:24:55 +0000 (21:24 +0200)
doc/fixes36.1
win/X11/winmisc.c

index a165348cf0587b223f993b28cab94e3e7a675984..3cc5261f68762e4dff41193da08ea62e572129bc 100644 (file)
@@ -101,6 +101,7 @@ MacOSX: force TIMED_DELAY build option on so that 'runmode' run-time option
        is functional
 X11: core bug for '`' (backtick) and #terrain commands was only noticed by
        X11 interface: impossible "add_menu: called before start_menu"
+X11: enable a scroll bar in menu windows
 
 
 General New Features
index 06eaaaa928b65b71b8a8f937b6ce7ad7a78cfb09..c966650c94b29abdca6e3c76a4aa11f3950dbca3 100644 (file)
@@ -18,6 +18,7 @@
 #include <X11/Xaw/Command.h>
 #include <X11/Xaw/Form.h>
 #include <X11/Xaw/Label.h>
+#include <X11/Xaw/Viewport.h>
 #include <X11/Xaw/Cardinals.h>
 #include <X11/Xos.h> /* for index() */
 #include <X11/Xatom.h>
@@ -844,7 +845,7 @@ Widget **command_widgets;
 XtCallbackProc name_callback;
 Widget *formp; /* return */
 {
-    Widget popup, form, label, above, left, right;
+    Widget popup, form, label, above, left, right, view;
     Widget *commands, *curr;
     int i;
     Arg args[8];
@@ -863,18 +864,24 @@ Widget *formp; /* return */
     XtOverrideTranslations(
         popup, XtParseTranslationTable("<Message>WM_PROTOCOLS: ec_delete()"));
 
+    num_args = 0;
+    XtSetArg(args[num_args], XtNforceBars, False); num_args++;
+    XtSetArg(args[num_args], XtNallowVert, True); num_args++;
+    view = XtCreateManagedWidget("menuformview", viewportWidgetClass, popup,
+                                 args, num_args);
+
     num_args = 0;
     XtSetArg(args[num_args], XtNtranslations,
              XtParseTranslationTable(popup_translations));
     num_args++;
-    *formp = form = XtCreateManagedWidget("menuform", formWidgetClass, popup,
+    *formp = form = XtCreateManagedWidget("menuform", formWidgetClass, view,
                                           args, num_args);
 
     /* Get the default distance between objects in the form widget. */
     num_args = 0;
     XtSetArg(args[num_args], nhStr(XtNdefaultDistance), &distance);
     num_args++;
-    XtGetValues(form, args, num_args);
+    XtGetValues(view, args, num_args);
 
     /*
      * Create the label.