STR #1460

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 ]

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:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text top right image
 
#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.  
bottom left image   bottom right image

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.