Add Fl::remove_handler() method.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2491 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
46148181bd
commit
16046bf4dd
1
CHANGES
1
CHANGES
@ -1,6 +1,7 @@
|
||||
CHANGES IN FLTK 1.1.0
|
||||
|
||||
- Config header file changes for Borland C++.
|
||||
- FLTK didn't provide a Fl::remove_handler() method.
|
||||
|
||||
|
||||
CHANGES IN FLTK 1.1.0rc4
|
||||
|
5
FL/Fl.H
5
FL/Fl.H
@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl.H,v 1.8.2.11.2.15 2002/04/13 22:17:45 easysw Exp $"
|
||||
// "$Id: Fl.H,v 1.8.2.11.2.16 2002/07/08 15:14:37 easysw Exp $"
|
||||
//
|
||||
// Main header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@ -168,6 +168,7 @@ public:
|
||||
static FL_EXPORT Fl_Widget* focus() {return focus_;}
|
||||
static FL_EXPORT void focus(Fl_Widget*);
|
||||
static FL_EXPORT void add_handler(int (*h)(int));
|
||||
static FL_EXPORT void remove_handler(int (*h)(int));
|
||||
|
||||
// cut/paste:
|
||||
static FL_EXPORT void copy(const char* stuff, int len, int clipboard = 0);
|
||||
@ -252,5 +253,5 @@ public:
|
||||
#endif // !Fl_H
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.H,v 1.8.2.11.2.15 2002/04/13 22:17:45 easysw Exp $".
|
||||
// End of "$Id: Fl.H,v 1.8.2.11.2.16 2002/07/08 15:14:37 easysw Exp $".
|
||||
//
|
||||
|
@ -106,6 +106,7 @@ state information and global methods for the current application.</P>
|
||||
<LI><A HREF="#Fl.release">release</A></LI>
|
||||
<LI><A HREF="#Fl.remove_check">remove_check</A></LI>
|
||||
<LI><A HREF="#Fl.remove_fd">remove_fd</A></LI>
|
||||
<LI><A HREF="#Fl.remove_handler">remove_handler</A></LI>
|
||||
<LI><A HREF="#Fl.remove_idle">remove_idle</A></LI>
|
||||
<LI><A HREF="#Fl.remove_timeout">remove_timeout</A></LI>
|
||||
<LI><A HREF="#Fl.repeat_timeout">repeat_timeout</A></LI>
|
||||
@ -927,6 +928,12 @@ callback that no longer exists.
|
||||
<H4><A NAME="Fl.remove_fd">void remove_fd(int, int when);<BR>
|
||||
void remove_fd(int);</A></H4>
|
||||
|
||||
<P>Removes a file descriptor handler.
|
||||
|
||||
<H4><A NAME="Fl.remove_handler">void remove_handler(int (*h)(int));</A></H4>
|
||||
|
||||
<P>Removes a previously added event handler.
|
||||
|
||||
<H4><A NAME="Fl.remove_idle">void remove_idle(void (*cb)(void*), void* = 0);</A></H4>
|
||||
|
||||
<P>Removes the specified idle callback, if it is installed.
|
||||
|
20
src/Fl.cxx
20
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 $".
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user