changeset 9224:b4563001d783

(make_menu_in_widget): Add support for displaying a title in pop up menus. (make_main, xm_set_main_areas, xm_manage_resizing): New functions to create and manage a Motif Main Window widget.
author Paul Reilly <pmr@pajato.com>
date Sun, 02 Oct 1994 11:48:42 +0000
parents da3ee9703b44
children 9e28a8ef9cad
files lwlib/lwlib-Xm.c
diffstat 1 files changed, 46 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/lwlib-Xm.c	Sun Oct 02 11:28:06 1994 +0000
+++ b/lwlib/lwlib-Xm.c	Sun Oct 02 11:48:42 1994 +0000
@@ -345,7 +345,13 @@
       XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
       XtSetArg (al [ac], XmNuserData, cur->call_data); ac++;
       
-      if (all_dashes_p (cur->name))
+      if (instance->pop_up_p && !cur->contents && !cur->call_data)
+	{
+	  ac = 0;
+	  XtSetArg (al[ac], XmNalignment, XmALIGNMENT_CENTER); ac++;
+	  button = XmCreateLabel (widget, cur->name, al, ac);
+	}
+      else if (all_dashes_p (cur->name))
 	{
 	  button = XmCreateSeparator (widget, cur->name, NULL, 0);
 	}
@@ -1515,3 +1521,42 @@
   XmProcessTraversal (w, 0);
   XtSetKeyboardFocus (parent, w);
 }
+
+/* Motif hack to set the main window areas. */
+void
+xm_set_main_areas (parent, menubar, work_area)
+     Widget parent;
+     Widget menubar;
+     Widget work_area;
+{
+  XmMainWindowSetAreas (parent,
+			menubar,	/* menubar (maybe 0) */
+			0,		/* command area (psheets) */
+			0,		/* horizontal scroll */
+			0,              /* vertical scroll */
+			work_area);	/* work area */
+}
+
+/* Motif hack to control resizing on the menubar. */
+void
+xm_manage_resizing (w, flag)
+     Widget w;
+     Boolean flag;
+{
+  if (flag)
+    {
+      /* Enable the edit widget for resizing. */
+      Arg al[1];
+      
+      XtSetArg (al[0], XtNallowShellResize, 0);
+      XtSetValues (w, al, 1);
+    }
+  else
+    {
+      /* Disable the edit widget from resizing. */
+      Arg al[1];
+      
+      XtSetArg (al[0], XtNallowShellResize, 0);
+      XtSetValues (w, al, 1);
+    }
+}