summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorPaul Reilly <pmr@pajato.com>1994-10-02 11:48:42 +0000
committerPaul Reilly <pmr@pajato.com>1994-10-02 11:48:42 +0000
commitf71b80328086dfed4c790a20bb6f0426507d9458 (patch)
treeb895bd8236dd09d8acb376ada7c2ba3daea7eed0 /lwlib
parentb194b572316a2fa6b5ef38c580cd25727f08473e (diff)
downloademacs-f71b80328086dfed4c790a20bb6f0426507d9458.tar.gz
(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.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/lwlib-Xm.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 16d25ea20a7..7444d3634dc 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -345,7 +345,13 @@ make_menu_in_widget (widget_instance* instance, Widget widget,
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 @@ xm_set_keyboard_focus (Widget parent, Widget w)
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);
+ }
+}