FLTK logo

RE: [fltk.general] Re: can I change the default attributes so I can set"global attributes"

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RE: Re: can I change the default attributes so I can set"global attributes" "'Philip Rose' via fltk.general" Sep 30, 2022  
 

From: roger tunnicliffe
Sent: 30 September 2022 14:17
To: fltk.general
Subject: [fltk.general] Re: can I change the default attributes so I can set"global attributes"

 

Great, thanks very much

Cheers

 

On Friday, September 30, 2022 at 9:32:18 PM UTC+10 Manolo wrote:

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.

 

--

 

Thanks, I have been wondering how to do this as well. It’s a pity that you have to change the meaning of FL_HELVETICA as that distracts from its real meaning.

Phil.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/633709cf.050a0220.fdcc6.1456SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.