diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-20 14:41:44 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-12-20 14:41:44 +0000 |
| commit | df9acaafea434e12d21077a7806867c99217a57d (patch) | |
| tree | f0939ab6eea3bb92acadf6d483938d28d8391df4 /src/Fl_display.cxx | |
| parent | 0215c7986c4f255d92753daddc0237f4e5a1a73b (diff) | |
Implement Fl::scheme() and Fl::reload_scheme() (this includes support
for new FLTK_SCHEME environment variable, which should get added to
FLTK 2.0 CVS, as well as the -scheme option...)
Revert Fl_Group/Fl_Widget destructor change - it doesn't work for
statically initialized widgets (like the widgets in a color chooser...)
Export fl_round_up_box() and fl_round_down_box() so they can be
restored in Fl::reload_scheme().
Use FL_DOWN_BOX and FL_ROUND_DOWN_BOX in menu drawing code.
Use a static string for the display environment variable in Fl::display().
Updated MacOS README file...
Added window tile image...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1883 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_display.cxx')
| -rw-r--r-- | src/Fl_display.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Fl_display.cxx b/src/Fl_display.cxx index c1324c33c..27b3c356d 100644 --- a/src/Fl_display.cxx +++ b/src/Fl_display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_display.cxx,v 1.4.2.3.2.1 2001/11/27 17:44:06 easysw Exp $" +// "$Id: Fl_display.cxx,v 1.4.2.3.2.2 2001/12/20 14:41:44 easysw Exp $" // // Display function for the Fast Light Tool Kit (FLTK). // @@ -31,17 +31,23 @@ #include <string.h> void Fl::display(const char *d) { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(WIN32) (void)d; #else - char *e = new char[strlen(d)+13]; + static char e[1024]; strcpy(e,"DISPLAY="); - strcpy(e+8,d); - for (char *c = e+8; *c!=':'; c++) if (!*c) {strcpy(c,":0.0"); break;} + strncat(e,d,sizeof(e) - 1); + e[sizeof(e) - 1] = '\0'; + for (char *c = e+8; *c!=':'; c++) { + if (!*c) { + strncat(e,":0.0",sizeof(e) - 1); + break; + } + } putenv(e); #endif // __APPLE__ } // -// End of "$Id: Fl_display.cxx,v 1.4.2.3.2.1 2001/11/27 17:44:06 easysw Exp $". +// End of "$Id: Fl_display.cxx,v 1.4.2.3.2.2 2001/12/20 14:41:44 easysw Exp $". // |
