From 6168f6fd4bb274af63f1fb91df18f448846e1646 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Fri, 26 Feb 2010 17:49:19 +0000 Subject: doc mods to support fl_eventnames[]. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7157 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/src/events.dox | 3 +++ documentation/src/subclassing.dox | 10 ++++++++++ 2 files changed, 13 insertions(+) (limited to 'documentation/src') diff --git a/documentation/src/events.dox b/documentation/src/events.dox index 21eb3f0b6..9ea3df10c 100644 --- a/documentation/src/events.dox +++ b/documentation/src/events.dox @@ -25,6 +25,9 @@ of the \p handle() method. +Event numbers can be converted to their actual names using the \ref fl_eventnames[] array +defined in \#include <FL/names.h>; see next chapter for details. + In the next chapter, the \ref subclassing_events "MyClass::handle()" example shows how to override the 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 // 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 -- cgit v1.2.3