Le dimanche 2 octobre 2022 à 05:42:32 UTC+2, roger a écrit :
I have been thru Enumerations and I can't find the variable so how to do I set all box types to FL_THIN_UP_BOX globallyThx
One solution is to derive a class from a widget sort frequently used in your GUI and to set the box type of
this class to FL_THIN_UP_BOX. Then, all widgets of this class wil have the desired thin up box.
If you use frequently several widgets sorts (e.g., Fl_Light_Button, Fl_Radio_Button), you would define one
derived class for each of them.
//
// Hello, World! program for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2021 by Bill Spitzak and others.
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
class myThinBox : public Fl_Box {
public:
myThinBox(int x, int y, int w, int h, const char *label) : Fl_Box(x, y, w, h, label) {
box(FL_THIN_UP_BOX);
}
};
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(340, 180);
myThinBox *box = new myThinBox(20, 40, 300, 100, "Hello, World!");
// you can create hundreds of myThinBox objects, they will all
// inherit the FL_THIN_UP_BOX property
box->labelfont(FL_BOLD + FL_ITALIC);
box->labelsize(36);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->show(argc, argv);
return Fl::run();
}