]> code.delx.au - gnu-emacs/blobdiff - lwlib/xlwmenu.c
*** empty log message ***
[gnu-emacs] / lwlib / xlwmenu.c
index cadd02584af65d9976fe146a9d6c4162f242f5c5..15f25371619db7c1841d4b5415e280fbbb0ffcd7 100644 (file)
@@ -112,6 +112,8 @@ xlwMenuResources[] =
      offset(menu.open), XtRCallback, (XtPointer)NULL},
   {XtNselect, XtCCallback, XtRCallback, sizeof(XtPointer), 
      offset(menu.select), XtRCallback, (XtPointer)NULL},
+  {XtNhighlightCallback, XtCCallback, XtRCallback, sizeof(XtPointer), 
+     offset(menu.highlight), XtRCallback, (XtPointer)NULL},
   {XtNmenu, XtCMenu, XtRPointer, sizeof(XtPointer),
      offset(menu.contents), XtRImmediate, (XtPointer)NULL},
   {XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
@@ -1246,6 +1248,11 @@ remap_menubar (mw)
   if (new_selection && !new_selection->enabled)
     new_selection = NULL;
 
+  /* Call callback when the hightlighted item changes.  */
+  if (old_selection || new_selection)
+    XtCallCallbackList ((Widget)mw, mw->menu.highlight,
+                       (XtPointer) new_selection);
+
   /* updates old_state from new_state.  It has to be done now because
      display_menu (called below) uses the old_stack to know what to display. */
   for (i = last_same + 1; i < new_depth; i++)
@@ -1419,7 +1426,7 @@ make_shadow_gcs (mw)
   unsigned long pm = 0;
   Display *dpy = XtDisplay ((Widget) mw);
   Screen *screen = XtScreen ((Widget) mw);
-  Colormap cmap = DefaultColormapOfScreen (screen);
+  Colormap cmap = mw->core.colormap;
   XColor topc, botc;
   int top_frobbed = 0, bottom_frobbed = 0;