| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
STR #1460
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 2 - Low, e.g. a documentation error or undocumented side-effect |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Documentation |
Summary: | Callback docs show a bad example |
Version: | 1.1-current |
Created By: | greg.ercolano |
Assigned To: | mike |
Fix Version: | 1.1-current (SVN: v5533) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | greg.ercolano 15:42 Oct 05, 2006 |
| This doc link has a problem: http://www.fltk.org/doc-1.1/common.html#4_9
The gray box that recommends how to setup callbacks is wrong; it should be revised as follows:
------ class foo { - void my_callback(Widget *); + void my_callback(Fl_Widget *); - static void my_static_callback(Widget *w, foo *f) { f->my_callback(w); } + static void my_static_callback(Fl_Widget *w, void *f) { ((foo*)f)->my_callback(w); } ... } ... - w->callback(my_static_callback, this); + w->callback(my_static_callback, (void*)this); ----------
Note changes not only for Widget -> Fl_Widget, but also changes from "foo *f" to "void *f", and "f->" to "((foo*)f)->"
Also, not required but IMHO it would be clearer if all references to 'foo' were changed to 'Foo'. | |
|
#2 | mike 05:51 Oct 29, 2006 |
| Fixed in Subversion repository. | |
[ Return to Bugs & Features ]
|
| |