summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-09-19 07:53:55 +0000
committerBill Spitzak <spitzak@gmail.com>2000-09-19 07:53:55 +0000
commit88076bafd122a78d31dc42db563dcca7f20d5528 (patch)
treee87f537b28510a2e78669b260f8769819bed53f5
parent33c5896a260f7217433319ef34e039864321e107 (diff)
Reads selectBackground from the xrdb database to set the selection color.
Adding this to your .Xdefaults will make fltk and Motif programs look much more Windoze-like: *selectForeground: white *selectBackground: #000080 git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1303 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_get_system_colors.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx
index 242839c16..774f6e6cd 100644
--- a/src/Fl_get_system_colors.cxx
+++ b/src/Fl_get_system_colors.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_get_system_colors.cxx,v 1.6.2.4 2000/06/05 21:21:01 mike Exp $"
+// "$Id: Fl_get_system_colors.cxx,v 1.6.2.5 2000/09/19 07:53:55 spitzak Exp $"
//
// System color support for the Fast Light Tool Kit (FLTK).
//
@@ -130,20 +130,21 @@ xdefaultcolor (const char *flcol, const char *key1, const char *key2)
return flcol;
}
+static void set_selection_color(uchar r, uchar g, uchar b) {
+ Fl::set_color(FL_SELECTION_COLOR,r,g,b);
+}
+
void Fl::get_system_colors()
{
fl_open_display();
-
- fl_bg2 = xdefaultcolor (fl_bg2, "Entry", "background");
- getsyscolor(fl_bg2,Fl::background2);
- fl_bg = xdefaultcolor (fl_bg, "*", "background");
- getsyscolor(fl_fg, Fl::foreground);
- fl_fg = xdefaultcolor (fl_fg, "*", "foreground");
- getsyscolor(fl_bg, Fl::background);
+ getsyscolor(xdefaultcolor(fl_bg2, "Entry", "background"), Fl::background2);
+ getsyscolor(xdefaultcolor(fl_bg, "*", "background"), Fl::background);
+ getsyscolor(xdefaultcolor(fl_fg, "*", "foreground"), Fl::foreground);
+ getsyscolor(xdefaultcolor(0,"Text","selectBackground"), set_selection_color);
}
#endif
//
-// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.4 2000/06/05 21:21:01 mike Exp $".
+// End of "$Id: Fl_get_system_colors.cxx,v 1.6.2.5 2000/09/19 07:53:55 spitzak Exp $".
//