summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2009-02-15 13:49:34 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2009-02-15 13:49:34 +0000
commite94b388899d16498f44afd1bb965a137345fcf6f (patch)
tree40ab590cc767b05e5077e6e549bda117ad660f62 /src/Fl.cxx
parent39c0a8a320a4d9799009f66ccd16288f361bc8f8 (diff)
renamed class Fl_Watch to Fl_Widget_Tracker, as discussed in fltk.development.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6659 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 0e5a1b251..de2b869e1 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1519,7 +1519,7 @@ static int max_widget_watch = 0;
/**
Adds a widget pointer to the widget watch list.
- \note Internal use only, please use class Fl_Watch instead.
+ \note Internal use only, please use class Fl_Widget_Tracker instead.
This can be used, if it is possible that a widget might be deleted during
a callback or similar function. The widget pointer must be added to the
@@ -1556,9 +1556,10 @@ static int max_widget_watch = 0;
\see Fl::clear_widget_pointer()
An easier and more convenient method to control widget deletion during
- callbacks is to use the class Fl_Watch with a local (automatic) variable.
+ callbacks is to use the class Fl_Widget_Tracker with a local (automatic)
+ variable.
- \see class Fl_Watch
+ \see class Fl_Widget_Tracker
*/
void Fl::watch_widget_pointer(Fl_Widget *&w)
{
@@ -1585,7 +1586,7 @@ void Fl::watch_widget_pointer(Fl_Widget *&w)
This is used to remove a widget pointer that has been added to the watch list
with Fl::watch_widget_pointer(), when it is not needed anymore.
- \note Internal use only, please use class Fl_Watch instead.
+ \note Internal use only, please use class Fl_Widget_Tracker instead.
\see Fl::watch_widget_pointer()
*/
@@ -1617,14 +1618,16 @@ void Fl::release_widget_pointer(Fl_Widget *&w)
This is called when a widget is destroyed (by its destructor). You should never
call this directly.
-
- \note Internal use only, please use class Fl_Watch instead.
-
- This method searches the widget watch list for pointers to the widget and clears
- all pointers that point to it. Widget pointers can be added to the widget
- watch list by calling Fl::watch_widget_pointer().
-
+
+ \note Internal use only !
+
+ This method searches the widget watch list for pointers to the widget and
+ clears each pointer that points to it. Widget pointers can be added to the
+ widget watch list by calling Fl::watch_widget_pointer() or by using the
+ helper class Fl_Widget_Tracker (recommended).
+
\see Fl::watch_widget_pointer()
+ \see class Fl_Widget_Tracker
*/
void Fl::clear_widget_pointer(Fl_Widget const *w)
{
@@ -1637,12 +1640,12 @@ void Fl::clear_widget_pointer(Fl_Widget const *w)
}
}
-// Helper class Fl_Watch
+// Helper class Fl_Widget_Tracker
/**
The constructor adds a widget to the watch list.
*/
-Fl_Watch::Fl_Watch(Fl_Widget *wi) {
+Fl_Widget_Tracker::Fl_Widget_Tracker(Fl_Widget *wi) {
wp_ = wi;
Fl::watch_widget_pointer(wp_); // add pointer to watch list
@@ -1651,7 +1654,7 @@ Fl_Watch::Fl_Watch(Fl_Widget *wi) {
/**
The destructor removes a widget from the watch list.
*/
-Fl_Watch::~Fl_Watch() {
+Fl_Widget_Tracker::~Fl_Widget_Tracker() {
Fl::release_widget_pointer(wp_); // remove pointer from watch list
}