summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-10-29 23:25:10 +0000
committerRichard M. Stallman <rms@gnu.org>1994-10-29 23:25:10 +0000
commit615e6c6cfe47bf07d4947665b2a210a65a106dff (patch)
tree42d63a4d04d494f6ea4ad5847c184510dde0eaa5
parent90a042253e038d9c994c5c06d18795d7f0f0a912 (diff)
downloademacs-615e6c6cfe47bf07d4947665b2a210a65a106dff.tar.gz
(xlwmenu_default_font): New global variable.
(XlwMenuInitialize): Use xlwmenu_default_font to default the font if necessary. Make mw, itself, an argument.
-rw-r--r--lwlib/xlwmenu.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index d06321257f9..a6e46584d65 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -33,6 +33,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
static int pointer_grabbed;
static XEvent menu_post_event;
+XFontStruct *xlwmenu_default_font;
+
static char
xlwMenuTranslations [] =
"<BtnDown>: start()\n\
@@ -1059,15 +1061,13 @@ release_shadow_gcs (mw)
}
static void
-XlwMenuInitialize (request, new, args, num_args)
+XlwMenuInitialize (request, mw, args, num_args)
Widget request;
- Widget new;
+ XlwMenuWidget mw;
ArgList args;
Cardinal *num_args;
{
/* Get the GCs and the widget size */
- XlwMenuWidget mw = (XlwMenuWidget)new;
-
XSetWindowAttributes xswa;
int mask;
@@ -1090,6 +1090,12 @@ XlwMenuInitialize (request, new, args, num_args)
gray_bits, gray_width,
gray_height, 1, 0, 1);
+ /* I don't understand why this ends up 0 sometimes,
+ but it does. This kludge works around it.
+ Can anyone find a real fix? -- rms. */
+ if (mw->menu.font == 0)
+ mw->menu.font = xlwmenu_default_font;
+
make_drawing_gcs (mw);
make_shadow_gcs (mw);