From: Leon B. <le...@bo...> - 2005-07-27 16:22:19
|
On Tuesday 26 July 2005 07:30 pm, Raymond Martin wrote: > > > Cannot see anything in the docs other than the > > > system-wide color-fg and color-bg variables. > > At this point, <color-fg> and <color-bg> are > > simply shortcuts for black and white. > Yes, but I see that when multiple windows are open in one Lush session > the text capable widgets are affected when these variables are changed. Still these are global constants with global effect. They were not meant to be modified. In fact the three special color codes, <color-fg>=-1, <color-bg>=-2, and <color-gray>=-3 were meant for black and white screen. Color screens for workstations were outrageously expensive then. If you ever try lush with a black and white visual you will find that it uses sophisticated dithering and is quite usable. Code <color-gray> does not produce a real gray but a 50% dithering. It applies to lines, fills but not text because it compromises readability. > So I guess I should have asked if it is possible to have > separate foreground/background color for different text widgets. > Any way to do such a thing yet? You'd have to subclass the widget class you are interested in, add slots (named <color-fg> and <color-bg> for instance), and redefine a constructor to initialize them properly. Chances are that you'll also have to override the <backpaint-color> and <repaint-color> methods because the current definitions assume that the color is already set to <color-fg>. So the overrides might be as simple as: (defmethod MyEditString repaint-color() (gsave (color color-fg) (==> (EditString . repaint-color)) ) - L. |