Re: can I change the default attributes so I can set "global attributes"
Manolo
Sep 30, 2022
Hi Roger,
FLTK uses these colors for these tasks :
FL_BACKGROUND_COLOR - the default background color FL_BACKGROUND2_COLOR - the default background color for text, list, and valuator widgets FL_FOREGROUND_COLOR - the default foreground color (0) used for labels and text FL_INACTIVE_COLOR - the inactive foreground color FL_SELECTION_COLOR - the default selection/highlight color
You can change their values by calling void Fl::set_color(Fl_Color i, unsigned c) with i set to, say, FL_BACKGROUND_COLOR and c to a predefined color name, say, FL_YELLOW; or by calling void Fl::set_color(Fl_Color i, uchar r, uchar g, uchar b) with i as above and r,g,b set to an RGB value (r, g and b should be in the range [0..255])
All widgets use this font size for their text Fl_Fontsize FL_NORMAL_SIZE = 14; you can change the value of this public global variable.
Widgets use FL_HELVETICA as default font. You can change the font associated to this numerical value by calling Fl::set_font(FL_HELVETICA, "name-of-a-font-as-given-by-test-program-fonts");
but caution that font names tend to be platform-specific.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.