diff options
Diffstat (limited to 'fluid/documentation/src')
| -rw-r--r-- | fluid/documentation/src/page_widget_panel.dox | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fluid/documentation/src/page_widget_panel.dox b/fluid/documentation/src/page_widget_panel.dox index 7a1261d62..d897037e4 100644 --- a/fluid/documentation/src/page_widget_panel.dox +++ b/fluid/documentation/src/page_widget_panel.dox @@ -369,13 +369,18 @@ \image html wp_cpp_callback.png \image latex wp_cpp_callback.png "" width=7cm - The callback field can be interpreted in two ways. If the callback text is only - a single word, FLUID assumes that this is the name of an external callback - function and declares it in the header as + The callback field can be interpreted in three ways. If the callback text is + only a single word, FLUID assumes that this is the name of an external + callback function and declares it in the header as `extern void my_button_action(Fl_Button*, void*);`. - Otherwise, FLUID assumes that the text is the body of a C++ callback function - and instead creates a local static callback function. The name of the callback + If the first letter of the callback text is a '[', FLUID expects a lambda + function which will be inlined into the widget creation code. The lambda + signature must be `[](Fl_Widget*, void*)->void { ... }`. The widget pointer + can be casted to another type inside the lambda. + + Otherwise, FLUID assumes that the text is the body of a C++ function, + and a local static callback function is created. The name of the callback function is generated by FLUID and guaranteed to be unique within the file. ``` static void cb_input(Fl_Input *o, void *v) { |
