summaryrefslogtreecommitdiff
path: root/documentation/src/subclassing.dox
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/src/subclassing.dox')
-rw-r--r--documentation/src/subclassing.dox10
1 files changed, 10 insertions, 0 deletions
diff --git a/documentation/src/subclassing.dox b/documentation/src/subclassing.dox
index 57c004165..4d452ccc1 100644
--- a/documentation/src/subclassing.dox
+++ b/documentation/src/subclassing.dox
@@ -302,6 +302,16 @@ You must return non-zero if your \p handle() method
uses the event. If you return zero, the parent widget will try
sending the event to another widget.
+For debugging purposes, event numbers can be printed as their actual event names
+using the fl_eventnames[] array, e.g.:
+\code
+ #include <FL/names.h> // defines fl_eventnames[]
+ [..]
+ int MyClass::handle(int e) {
+ printf("Event was %s (%d)\n", fl_eventnames[e], e); // e.g. "Event was FL_PUSH (1)"
+ [..]
+\endcode
+
\section subclassing_drawing Drawing the Widget
The \p draw() virtual method is called when FLTK wants