home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lucidem / bug / 534 < prev    next >
Encoding:
Text File  |  1993-01-27  |  9.5 KB  |  327 lines

  1. x-gateway: rodan.UU.NET from bug-lucid-emacs to alt.lucid-emacs.bug; Wed, 27 Jan 1993 18:07:35 EST
  2. Return-Path: <bcotton@maestro.mitre.org>
  3. Date: Wed, 27 Jan 1993 14:06:17 EST
  4. From: bcotton@maestro.mitre.org (Bob Cotton)
  5. Message-ID: <9301271906.AA04479@maestro.mitre.org>
  6. Subject: Re: Problems building/running 19.4
  7. References: <9301251621.AA00731@simpson.ingr.com>
  8. Newsgroups: alt.lucid-emacs.bug
  9. Path: sparky!uunet!wendy-fate.uu.net!bug-lucid-emacs
  10. Sender: bug-lucid-emacs-request@lucid.com
  11. Lines: 314
  12.  
  13. A couple of people have been trying to compile lemacs-19.4 with
  14. motif1.2.1 (including me).  After talking with Jamie about itm this is
  15. what I have.
  16.  
  17.   o  I replaced the athena Paned widget with a motif PanedWindow.
  18.   o  I commented out the XmProcessTraversal (Caused a core dump) in xm_set_keyboard_focus()
  19.   o  I Added support for Tear-off menus (That's what started this whole thing)
  20.  
  21. This is by no means a complete patch.. I just thought  I would share
  22. what I have with others because I'm stuck..
  23.  
  24. I have observed the following not to work..
  25.  
  26.   o The geometry of the main window gets messed up when any 
  27.     screen is mapped.
  28.   o If you cause a pulldown to stay mapped, then click outside of the
  29.     menu to make it go away, it won't, and you can never get rid of it.
  30.     But you can still type into the emacs window...
  31.   o The following function I have bound to Button3 displays the above
  32.     behavior, and it will not switch to the buffer selected:
  33.  
  34. (defun buffer-list-on-three (e)
  35.   (interactive "e")
  36.  (let ((buffer-menu (car (find-menu-item current-menubar '("Buffers"))))
  37.     name
  38.     buffers)
  39.     (if (not buffer-menu)
  40.     nil
  41.       (setq buffers (buffer-list))
  42.       (setq buffers
  43.         (mapcar (function
  44.              (lambda (buffer)
  45.                (if (setq name (format-buffers-menu-line buffer))
  46.                (vector name
  47.                  (list 'switch-to-buffer (buffer-name buffer))
  48.                  t))))
  49.             buffers))
  50.       (setcdr buffer-menu buffers))
  51.   (popup-menu buffer-menu)
  52.   ))
  53.  
  54. (define-key global-map 'button3 'buffer-list-on-three)
  55.  
  56.   o When running packages that put a menu entry into the menubar,
  57.     like Gnus and Vm, the following happens...
  58.  
  59. Program received signal 11, Segmentation fault
  60. 0x11160c in _XmGetActiveTopLevelMenu ()
  61. (gdb) where
  62. #0  0x11160c in _XmGetActiveTopLevelMenu ()
  63. #1  0x11177c in _XmGetActiveTopLevelMenu ()
  64. #2  0x119f60 in _XmCallRowColumnUnmapCallback ()
  65. #3  0xdb344 in _XmCascadingPopup ()
  66. #4  0x1a9468 in XtCreateApplicationShell ()
  67. #5  0x1a9360 in XtCreateApplicationShell ()
  68. #6  0x1a977c in XtCreateApplicationShell ()
  69. #7  0x1a98b8 in _XtDoPhase2Destroy ()
  70. #8  0x1a9a44 in XtDestroyWidget ()
  71. #9  0xd4698 in destroy_all_children (widget=0x308800) at lwlib-Xm.c:154
  72. #10 0xd54e8 in xm_update_menu (instance=0x373e80, widget=0x308800,
  73.     val=0x378a00, deep_p=0 '\000') at lwlib-Xm.c:457
  74. #11 0xd59dc in xm_update_one_widget (instance=0x373e80, widget=0x308800,
  75.     val=0x378a00, deep_p=0 '\000') at lwlib-Xm.c:563
  76. #12 0xd2d88 in set_one_value (instance=0x373e80, val=0x378a00, deep_p=0 '\000')
  77.     at lwlib.c:489
  78. #13 0xd2e08 in update_one_widget_instance (instance=0x373e80, deep_p=0 '\000')
  79.     at lwlib.c:510
  80. #14 0xd2e64 in update_all_widget_values (info=0x378a40, deep_p=0 '\000')
  81.     at lwlib.c:519
  82. #15 0xd30e8 in lw_modify_all_widgets (id=3197952, val=0x2fb240,
  83.     deep_p=0 '\000') at lwlib.c:571
  84. #16 0x4b004 in set_screen_menubar (s=0x30cc00, deep_p=0) at menubar.c:518
  85. #17 0x4c444 in update_screen_menubars () at menubar.c:975
  86. #18 0xf0ec in redisplay () at xdisp.c:729
  87. .....
  88.  
  89. But lemacs will come up, and the Tear-off menus do work.. 
  90.  
  91. Any other sugestions?
  92.  
  93. Bob
  94.  
  95. ---------------------%<---------------------------------------------------------
  96.  
  97. diff -r -c src/lwlib/lwlib-Xm.c my-src/lwlib/lwlib-Xm.c
  98. *** src/lwlib/lwlib-Xm.c    Wed Jan 20 04:44:29 1993
  99. --- my-src/lwlib/lwlib-Xm.c    Tue Jan 26 09:36:40 1993
  100. ***************
  101. *** 364,369 ****
  102. --- 364,370 ----
  103.         else
  104.       {
  105.         menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
  106. +       XtVaSetValues(menu, XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL);
  107.         make_menu_in_widget (instance, menu, cur->contents);
  108.         XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
  109.         button = XmCreateCascadeButton (widget, cur->name, al, ac);
  110. ***************
  111. *** 427,432 ****
  112. --- 428,434 ----
  113.         if (contents)
  114.       {
  115.         menu = XmCreatePulldownMenu (widget, "pulldown", NULL, 0);
  116. +       XtVaSetValues(menu, XmNtearOffModel, XmTEAR_OFF_ENABLED, NULL);
  117.         make_menu_in_widget (instance, menu, contents);
  118.         ac = 0;
  119.         XtSetArg (al [ac], XmNsubMenuId, menu); ac++;
  120. ***************
  121. *** 1428,1433 ****
  122.   void
  123.   xm_set_keyboard_focus (Widget parent, Widget w)
  124.   {
  125. !   XmProcessTraversal (w, 0);
  126.     XtSetKeyboardFocus (parent, w);
  127.   }
  128. --- 1430,1435 ----
  129.   void
  130.   xm_set_keyboard_focus (Widget parent, Widget w)
  131.   {
  132. !  /*  XmProcessTraversal (w, XmTRAVERSE_CURRENT);*/
  133.     XtSetKeyboardFocus (parent, w);
  134.   }
  135. diff -r -c src/menubar.c my-src/menubar.c
  136. *** src/menubar.c    Wed Jan 20 05:31:16 1993
  137. --- my-src/menubar.c    Wed Jan 27 13:32:21 1993
  138. ***************
  139. *** 25,31 ****
  140. --- 25,37 ----
  141.   
  142.   #include <X11/Intrinsic.h>
  143.   #include <X11/StringDefs.h>
  144. + #ifdef LWLIB_USES_MOTIF
  145. + #include <Xm/PanedW.h>
  146. + #include <Xm/SashP.h>
  147. + #else
  148.   #include <X11/Xaw/Paned.h>
  149. + #endif
  150.   
  151.   #include "lwlib.h"
  152.   
  153. ***************
  154. *** 472,477 ****
  155. --- 478,486 ----
  156.   set_screen_menubar (struct screen *s, int deep_p)
  157.   {
  158.     widget_value *data;
  159. +   Widget *children;
  160. +   XtWidgetGeometry size;
  161. +   int num_children;
  162.     Lisp_Object obuf = Fcurrent_buffer ();
  163.     Lisp_Object menubar;
  164.   
  165. ***************
  166. *** 525,535 ****
  167. --- 534,558 ----
  168.                   0, pre_activate_callback,
  169.                   menubar_selection_callback, 0);
  170.       s->display.x->menubar_widget = menubar_widget;
  171. +     size.request_mode = CWHeight;
  172. +     XtQueryGeometry(menubar_widget, NULL, &size);
  173. +     
  174.       XtVaSetValues (menubar_widget,
  175. + #ifdef LWLIB_USES_MOTIF
  176. +                XmNseparatorOn, False,
  177. +                XmNallowResize, True,
  178. +                /* Set these equal to make the "Slider" go away  */
  179. +                XmNpaneMinimum, size.height,
  180. +                XmNpaneMaximum, size.height,
  181. +                XmNpositionIndex, XmFIRST_POSITION,
  182. + #else
  183.                  XtNshowGrip, 0,
  184.                  XtNresizeToPreferred, 1,
  185.                  XtNallowResize, 1,
  186. + #endif
  187.                  0);
  188. +     
  189.         }
  190.       UNBLOCK_INPUT;
  191.     }
  192. ***************
  193. *** 996,1002 ****
  194. --- 1019,1027 ----
  195.       return;
  196.   
  197.     BLOCK_INPUT;
  198. + #ifndef LWLIB_USES_MOTIF
  199.     XawPanedSetRefigureMode (x->column_widget, 0);
  200. + #endif
  201.     
  202.     /* the order in which children are managed is the top to
  203.        bottom order in which they are displayed in the paned window.
  204. ***************
  205. *** 1089,1095 ****
  206. --- 1114,1122 ----
  207.     XtManageChild (x->edit_widget);
  208.   
  209.     /* and now thrash the sizes */
  210. + #ifndef LWLIB_USES_MOTIF
  211.     XawPanedSetRefigureMode (x->column_widget, 1);
  212. + #endif
  213.     UNBLOCK_INPUT;
  214.   }
  215.   
  216. diff -r -c src/xfns.c my-src/xfns.c
  217. *** src/xfns.c    Sun Jan 17 17:39:46 1993
  218. --- my-src/xfns.c    Tue Jan 26 11:07:52 1993
  219. ***************
  220. *** 32,38 ****
  221. --- 32,42 ----
  222.   #include <X11/Xresource.h>
  223.   #include <X11/Shell.h>
  224.   
  225. + #ifdef LWLIB_USES_MOTIF
  226. + #include <Xm/PanedW.h>
  227. + #else
  228.   #include <X11/Xaw/Paned.h>
  229. + #endif
  230.   #include <X11/Xaw/Label.h>
  231.   
  232.   #include <X11/Xos.h>
  233. ***************
  234. *** 375,382 ****
  235.     Widget w;
  236.   {
  237.     BLOCK_INPUT;
  238. !   XtVaSetValues (w, XtNshowGrip, 0, XtNresizeToPreferred, 1,
  239. !          XtNallowResize, 1, 0);
  240.     UNBLOCK_INPUT;
  241.   }
  242.   
  243. --- 379,394 ----
  244.     Widget w;
  245.   {
  246.     BLOCK_INPUT;
  247. !   XtVaSetValues (w,
  248. ! #ifdef LWLIB_USES_MOTIF
  249. !          XmNallowResize, True,
  250. !          XmNseparatorOn, False,
  251. ! #else
  252. !          XtNshowGrip, 0,
  253. !          XtNresizeToPreferred, 1,
  254. !          XtNallowResize, 1,
  255. ! #endif
  256. !          0);
  257.     UNBLOCK_INPUT;
  258.   }
  259.   
  260. ***************
  261. *** 690,711 ****
  262. --- 702,740 ----
  263.     maybe_set_screen_title_format (shell_widget);
  264.   
  265.     ac = 0;
  266. + #ifdef LWLIB_USES_MOTIF 
  267. +   XtSetArg (al[ac], XmNborderWidth, 0); ac++;
  268. +   XtSetArg (al[ac], XmNmarginHeight, 0); ac++;
  269. +   XtSetArg (al[ac], XmNmarginWidth, 0); ac++;
  270. +   pane_widget = XtCreateWidget ("pane", xmPanedWindowWidgetClass, shell_widget, al,
  271. +                 ac);
  272. + #else
  273.     XtSetArg (al[ac], XtNborderWidth, 0); ac++;
  274.     pane_widget = XtCreateWidget ("pane", panedWidgetClass, shell_widget, al,
  275.                   ac);
  276. + #endif
  277.   
  278.     /* mappedWhenManaged to false tells to the paned window to not map/unmap 
  279.      * the emacs screen when changing menubar.  This reduces flickering a lot.
  280.      */
  281.     ac = 0;
  282. + #ifdef LWLIB_USES_MOTIF
  283. +   XtSetArg (al[ac], XmNmappedWhenManaged, 0); ac++;
  284. +   XtSetArg (al[ac], XmNallowResize, True); ac++;
  285. +   XtSetArg (al[ac], XmNseparatorOn, False); ac++;
  286. +   XtSetArg (al[ac], XmNpositionIndex, XmLAST_POSITION); ac++;
  287. +   
  288. + #else
  289.     XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
  290.     XtSetArg (al[ac], XtNshowGrip, 0); ac++;
  291.     XtSetArg (al[ac], XtNallowResize, 1); ac++;
  292.     XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
  293. + #endif
  294.     XtSetArg (al[ac], XtNemacsScreen, s); ac++;
  295.     screen_widget = XtCreateWidget ("screen", emacsScreenWidgetClass,
  296.                     pane_widget, al, ac);
  297.   
  298.     s->display.x->widget = shell_widget;
  299.     s->display.x->column_widget = pane_widget;
  300.     s->display.x->edit_widget = screen_widget;
  301. ***************
  302. *** 939,945 ****
  303. --- 968,976 ----
  304.   #ifdef LINE_INFO_WIDGET
  305.     
  306.     BLOCK_INPUT;
  307. + #ifndef LWLIB_USES_MOTIF
  308.     XawPanedSetRefigureMode (x->row_widget, 0);
  309. + #endif
  310.     
  311.     /* the order in which children are managed is the top to
  312.        bottom order in which they are displayed in the paned window. */
  313. ***************
  314. *** 965,971 ****
  315. --- 996,1004 ----
  316.     if (just_created)
  317.       XStoreName (x_current_display, XtWindow(x->lineinfo_widget), "lineinfo_widget");
  318.   
  319. + #ifndef LWLIB_USES_MOTIF
  320.     XawPanedSetRefigureMode (x->row_widget, 1);
  321. + #endif
  322.   
  323.     UNBLOCK_INPUT;
  324.