Allowing to use FLTK objects in static initializers (cont'd).

Mac OS: a more convenient position where to initialize the fl_fonts global variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10964 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2015-12-13 13:24:17 +00:00
parent 69644d4032
commit 291cf838bf
2 changed files with 3 additions and 3 deletions

View File

@ -76,6 +76,9 @@ void Fl_Graphics_Driver::text_extents(const char*t, int n, int& dx, int& dy, int
/** A constructor that sets the graphics driver used by the display */
Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(graphics_driver) {
this->set_current();
#ifdef __APPLE__
if (!fl_fonts) fl_fonts = Fl_X::calc_fl_fonts(); // make sure fl_fonts is initialized
#endif
};

View File

@ -145,9 +145,6 @@ Fl_Widget::Fl_Widget(int X, int Y, int W, int H, const char* L) {
if (!been_here) {
been_here = 1;
Fl_Display_Device::display_device(); // make sure fl_graphics_driver is initialized
#ifdef __APPLE__
fl_fonts = Fl_X::calc_fl_fonts(); // make sure fl_fonts is initialized
#endif
}
}