Jan Rychter wrote:
I've asked about this in comp.emacs.xemacs, but got no answers,
so I'll
try here.
1. Is there a way to set the background color for the current frame from
within XEmacs? I would like to achieve the effect of "xemacs -bg
white". Comes in very useful when you work on your laptop in the sun.
M-: (set-face-background 'default "white" (selected-frame))
2. Why, if I run XEmacs as "xemacs -bg white", does it
think the display
is 1-bit?
It doesn't think that the display is 1-bpp. If it did, you wouldn't be
able to get coloured text.
All the widgets look ugly, because it tries to do 1-bit
dithering.
This occurs when the shadow colour matches the background colour.
lwlib/xlwscrollbar.c has:
if (w->sb.topShadowColor == w->core.background_pixel ||
w->sb.bottomShadowColor == w->core.background_pixel)
{
/* Assume we're in mono. This code should be okay even if we're
* really in color but just short on color cells -- We want the
* following behavior, which has been empirically determined to
* work well for all fg/bg combinations in mono: If the trough
* and slider are BOTH black, then use a white top shadow and a
* grey bottom shadow, otherwise use a grey top shadow and a
* black bottom shadow.
*/
Pixel white = WhitePixelOfScreen (DefaultScreenOfDisplay (XtDisplay (w)));
Pixel black = BlackPixelOfScreen (DefaultScreenOfDisplay (XtDisplay (w)));
/* Note: core.background_pixel is the color of the slider ... */
if (w->core.background_pixel == black &&
w->sb.troughColor == black)
{
w->sb.topShadowColor = white;
w->sb.bottomShadowPixmap = w->sb.grayPixmap;
} else {
w->sb.topShadowPixmap = w->sb.grayPixmap;
w->sb.bottomShadowColor = black;
}
}
You can prevent this behaviour by providing an explicit setting for
the topShadowColor resource, rather than allowing it to be computed,
e.g.
xemacs -bg white -xrm '*topShadowColor: grey90'
--
Glynn Clements <glynn.clements(a)virgin.net>