You cannot delete a widget inside a callback, as the + You cannot delete a widget inside a callback, as the widget may still be accessed by FLTK after your callback is completed. Instead, use the Fl::delete_widget() method to mark your widget for deletion when it is safe to do so. -
Hint: + Hint: -
Many programmers new to FLTK or C++ try to use a + Many programmers new to FLTK or C++ try to use a non-static class method instead of a static class method or function for their callback. Since callbacks are done outside a C++ class, the this pointer is not initialized for class methods. -
To work around this problem, define a static method + To work around this problem, define a static method in your class that accepts a pointer to the class, and then have the static method call the class method(s) as needed. The data pointer you provide to the - \c callback() method of the widget can be a + \p callback() method of the widget can be a pointer to the instance of your class. \code @@ -569,7 +574,7 @@ w->callback(my_static_callback, (void *)this); \section common_shortcuts Shortcuts Shortcuts are key sequences that activate widgets such as -buttons or menu items. The \c shortcut() method sets the +buttons or menu items. The \p shortcut() method sets the shortcut for a widget: \code @@ -582,9 +587,9 @@ button->shortcut(0); // no shortcut \endcode The shortcut value is the key event value - the ASCII value -or one of the special keys like -FL_Enter - -combined with any modifiers like \c Shift , \c Alt , and \c Control . +or one of the special keys described in +\ref enumerations_event_key +combined with any modifiers like \p Shift , \p Alt , and \p Control. \htmlonly diff --git a/documentation/src/drawing.dox b/documentation/src/drawing.dox index 37cdbfee9..72957ac25 100644 --- a/documentation/src/drawing.dox +++ b/documentation/src/drawing.dox @@ -60,6 +60,7 @@ The first box drawing function is fl_draw_box() which draws a standard boxtype \p b in the specified color \p c . +\anchor drawing_fl_frame void fl_frame(const char *s, int x, int y, int w, int h) \par