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" Greg Ercolano Oct 01, 2022  
 


On 10/1/22 15:12, roger tunnicliffe wrote:
FL_NORMAL_SIZE = 11;
FL_NORMAL_SIZE’ does not name a type

    Make sure you've got:

        #include <FL/Fl.H>

    ..at the top of your program.


Fl_Fontsize FL_NORMAL_SIZE = 11;

    Yea, no, don't do that. That just tries to /create/ another global variable of the
    same name as the one in FLTK, and fails at link time with the conflict.

    Here's a complete program showing where you should put what:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>

int main(int argc, char **argv) {
  FL_NORMAL_SIZE = 20;
  Fl_Window *window = new Fl_Window(340, 180);
  new Fl_Button(20, 40,  300, 50, "Hello World!");
  new Fl_Box(   20, 100, 300, 50, "Some text.");
  window->end();
  window->show();
  return Fl::run();
}

    If you change the value for FL_NORMAL_SIZE to something else, that should affect
    the size of all fonts.

--
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/d0ebfc20-0954-08b5-f925-9b4c44bfaccb%40seriss.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'.