summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-07-08 15:14:38 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-07-08 15:14:38 +0000
commit16046bf4ddb21381968b7333318e58b6438c89ac (patch)
treee18c0a49cf2f8e092a38abfa6ef730e8a11409b6 /src
parent46148181bdc020adffdc2be83364a37469cd83e6 (diff)
Add Fl::remove_handler() method.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2491 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 16690b930..ccffdda02 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.cxx,v 1.24.2.41.2.39 2002/06/27 20:52:44 easysw Exp $"
+// "$Id: Fl.cxx,v 1.24.2.41.2.40 2002/07/08 15:14:38 easysw Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -391,6 +391,22 @@ void Fl::add_handler(int (*h)(int)) {
handlers = l;
}
+void Fl::remove_handler(int (*h)(int)) {
+ handler_link *l, *p;
+
+ // Search for the handler in the list...
+ for (l = handlers, p = 0; l && l->handle != h; p = l; l = l->next);
+
+ if (l) {
+ // Found it, so remove it from the list...
+ if (p) p->next = l->next;
+ else handlers = l->next;
+
+ // And free the record...
+ delete l;
+ }
+}
+
int (*fl_local_grab)(int); // used by fl_dnd.cxx
static int send_handlers(int event) {
@@ -933,5 +949,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.41.2.39 2002/06/27 20:52:44 easysw Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.41.2.40 2002/07/08 15:14:38 easysw Exp $".
//