summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl.cxx16
2 files changed, 18 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 4fd6d89d7..6e12f75ef 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - added "Fl::has_check()" which previously was prototyped
+ and documented, but not implemented (STR #1542)
- enabled "add_check()" on OS X (STR #1534)
- Documented tooltip inheritance (STR #1467)
- Better event mouse handling fixing detached menus and
diff --git a/src/Fl.cxx b/src/Fl.cxx
index d17f64823..28f80225d 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -260,6 +260,22 @@ void Fl::remove_check(Fl_Timeout_Handler cb, void *argp) {
}
}
+/**
+ * Return 1, if a check with the same handler and data pointer
+ * is pending, 0 otherwise.
+ */
+int Fl::has_check(Fl_Timeout_Handler cb, void *argp) {
+ for (Check** p = &first_check; *p;) {
+ Check* t = *p;
+ if (t->cb == cb && t->arg == argp) {
+ return 1;
+ } else {
+ p = &(t->next);
+ }
+ }
+ return 0;
+}
+
static void run_checks()
{
// checks are a bit messy so that add/remove and wait may be called