("Korean"): Doc fix.
[bpt/emacs.git] / lwlib / lwlib-Xaw.c
index 76628ab..2168565 100644 (file)
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 
@@ -35,7 +36,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include <X11/Xatom.h>
 
-static void xaw_generic_callback (Widget, XtPointer, XtPointer);
+static void xaw_generic_callback (/*Widget, XtPointer, XtPointer*/);
 
 
 Boolean
@@ -220,8 +221,10 @@ xaw_pop_instance (instance, up)
             life easier?
           */
          {
-           int x, y, w, h;
+           unsigned int x, y, w, h;
            Widget topmost = instance->parent;
+           Arg args[2];
+
            w = shell->core.width;
            h = shell->core.height;
            while (topmost->core.parent && XtIsRealized (topmost->core.parent))
@@ -230,7 +233,12 @@ xaw_pop_instance (instance, up)
            else x = topmost->core.x + ((topmost->core.width - w) / 2);
            if (topmost->core.height < h) y = topmost->core.y;
            else y = topmost->core.y + ((topmost->core.height - h) / 2);
-           XtMoveWidget (shell, x, y);
+           /* Using XtMoveWidget caused the widget to come
+              out in the wrong place with vtwm.
+              Question of virtual vs real coords, perhaps.  */
+           XtSetArg (args[0], XtNx, x);
+           XtSetArg (args[1], XtNy, y);
+           XtSetValues (shell, args, 2);
          }
 
          /* Finally, pop it up. */
@@ -299,6 +307,10 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, ra
   ac = 0;
   XtSetArg (av[ac], XtNtitle, shell_title); ac++;
   XtSetArg (av[ac], XtNallowShellResize, True); ac++;
+
+  /* Don't allow any geometry request from the user.  */
+  XtSetArg (av[ac], XtNgeometry, 0); ac++;
+
   shell = XtCreatePopupShell ("dialog", transientShellWidgetClass,
                              parent, av, ac);
   XtOverrideTranslations (shell, override);
@@ -613,9 +625,24 @@ xaw_create_scrollbar (instance)
 #endif
 }
 
+static Widget
+xaw_create_main (instance)
+     widget_instance *instance;
+{
+  Arg al[1];
+  int ac;
+
+  /* Create a vertical Paned to hold menubar */
+  ac = 0;
+  XtSetArg (al[ac], XtNborderWidth, 0); ac++;
+  return XtCreateWidget (instance->info->name, panedWidgetClass,
+                        instance->parent, al, ac);
+}
+
 widget_creation_entry
 xaw_creation_table [] =
 {
   {"scrollbar",                        xaw_create_scrollbar},
+  {"main",                     xaw_create_main},
   {NULL, NULL}
 };