diff --git a/CHANGES b/CHANGES index 45a7fce3a..1d8251b35 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ CHANGES IN FLTK 1.1.6 - Documentation updates (STR #552, STR #608) + - Added the 2.0 Fl_Widget::copy_label() method to + allow FLTK 1.x applications to have their label + strings managed by FLTK (STR #630) + - Added Fl::delete_widget() method to safely delete + widgets in callback methods (STR #629) - Fl_Widget::damage(uchar,int,int,int,int) didn't clip the bounding box properly (STR #626) - Windows could appear on the wrong screen on OSX (STR diff --git a/FL/Fl.H b/FL/Fl.H index d0f65683c..9971de1de 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1,5 +1,5 @@ // -// "$Id: Fl.H,v 1.8.2.11.2.23 2004/04/11 04:38:53 easysw Exp $" +// "$Id: Fl.H,v 1.8.2.11.2.24 2004/11/23 19:47:50 easysw Exp $" // // Main header file for the Fast Light Tool Kit (FLTK). // @@ -257,10 +257,14 @@ public: static void unlock(); static void awake(void* message = 0); static void* thread_message(); + + // Widget deletion: + static void delete_widget(Fl_Widget *w); + static void do_widget_deletion(); }; #endif // !Fl_H // -// End of "$Id: Fl.H,v 1.8.2.11.2.23 2004/04/11 04:38:53 easysw Exp $". +// End of "$Id: Fl.H,v 1.8.2.11.2.24 2004/11/23 19:47:50 easysw Exp $". // diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index 7fed7af76..e33e1d47d 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget.H,v 1.6.2.4.2.25 2004/09/24 16:00:08 easysw Exp $" +// "$Id: Fl_Widget.H,v 1.6.2.4.2.26 2004/11/23 19:47:50 easysw Exp $" // // Widget header file for the Fast Light Tool Kit (FLTK). // @@ -90,7 +90,7 @@ protected: void set_flag(int c) {flags_ |= c;} void clear_flag(int c) {flags_ &= ~c;} enum {INACTIVE=1, INVISIBLE=2, OUTPUT=4, SHORTCUT_LABEL=64, - CHANGED=128, VISIBLE_FOCUS=512}; + CHANGED=128, VISIBLE_FOCUS=512, COPIED_LABEL = 1024}; void draw_box() const; void draw_box(Fl_Boxtype, Fl_Color) const; @@ -131,7 +131,8 @@ public: void selection_color(unsigned a) {color2_ = a;} void color(unsigned a, unsigned b) {color_=a; color2_=b;} const char* label() const {return label_.value;} - void label(const char* a) {label_.value=a; redraw_label();} + void label(const char* a); + void copy_label(const char* a); void label(Fl_Labeltype a,const char* b) {label_.type = a; label_.value = b;} Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;} void labeltype(Fl_Labeltype a) {label_.type = a;} @@ -217,5 +218,5 @@ public: #endif // -// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.25 2004/09/24 16:00:08 easysw Exp $". +// End of "$Id: Fl_Widget.H,v 1.6.2.4.2.26 2004/11/23 19:47:50 easysw Exp $". // diff --git a/documentation/Fl.html b/documentation/Fl.html index 5e34d8394..96791f3d3 100644 --- a/documentation/Fl.html +++ b/documentation/Fl.html @@ -49,6 +49,7 @@ state information and global methods for the current application.
This is the default callback for window widgets. It hides the +window and then calls the default widget callback.
+ +Schedules a widget for deletion when it is safe to do so. Use +this method to delete a widget inside a callback function. When +deleting groups or windows, you must only delete the group or +window widget and not the individual child widgets.
+Sets the X display to use for all windows. Actually this just sets diff --git a/documentation/Fl_Widget.html b/documentation/Fl_Widget.html index f7e0e09e5..179693959 100644 --- a/documentation/Fl_Widget.html +++ b/documentation/Fl_Widget.html @@ -53,6 +53,7 @@ to call redraw() after these.
Sets the current label. Unlike label(), this method +allocates a copy of the label string instead of using the +original string pointer.
+ +Hint: + | Note:
+
+ You cannot delete a widget inside a callback, as the + widget may still be accessed by FLTK after your callback + is completed. Instead, use the Fl::delete_widget() + method to mark your widget for deletion when it is safe + to do so. + +Hint: Many programmers new to FLTK or C++ try to use a non-static class method instead of a static class method diff --git a/documentation/index.html b/documentation/index.html index 97bd3e884..2853526ba 100644 --- a/documentation/index.html +++ b/documentation/index.html @@ -1,7 +1,7 @@ - |
- FLTK 1.1.5 Programming Manual-Revision 5 by Michael Sweet, Craig P. Earls, and Bill Spitzak FLTK 1.1.6 Programming Manual+Revision 6 by Michael Sweet, Craig P. Earls, and Bill Spitzak |