FLTKCallback++

Download
Instalation
Documentation


SourceForge Logo

FltkCallback++-0.1.0 Web Page

There is new web page dedicated to FC++0.1.0 which is not compatible with FC++0.0.x. I stoped developing FC++0.0.x so these pages are obsolete.

News

20 Feb 2002

FLTKCallback++ version 0.0.2 released (only for fltk-1.0.11). Known bugs are fixed and some other features were added.

About

FLTKCallback++ is small package which adds more C++ in fltk callback system. It uses templates which are now full supported by leading compilers. Idea was to extend current callback system with possibility to use any kind of functions or member functions as calbacks. I built fltk-1.0.11 with this new callback system on Linux (g++) and on MS Windows (Borland free commandline tools). On Linux fluid and all test were built without problems and they are working fine. On windows I only built fluid without problems but I did not have time to build test. I doubt that you will have problems to build tests on MS Windows. I created some small test to test FLTKCallback++ which also were built and executed without problems.

FLTKCallback++ has some similarity with sigc++ library so users of that library will easily understand it. This similarity is in syntax not philosophy. Main differences are:

  • instead of slot(...) factory here you call Fl_Callback_C (this is not function it is Fl_Callback_C class constructor but syntax is the same). So in sigc++:
      
    signal.connect(slot(object,Object::&method));  
    signal.connect(slot(&function));
    is in FLTKCallback++:
      
    callback(Fl_Callback_C(object, Object::&method, possible_arguments_values));  
    callback(Fl_Callback_C(&function, possible_arguments_values))  
    
  • you must supply values for arguments in Fl_Callback_C (slot() in sigc++) call

The code is under GNU LGPL.

Features and Drawbacks

Main features:

  • It is compatible with "old" callback system so you would not have to rewrite your apps.
  • You can use almost any function or member function as callback. The restriction is that you can use functions with maximum 2 arguments.
  • You can easily add support for functions with more that 2 arguments.

Main drawbacks:

  • Because it is not possible to assign arguments when callback is called you must assign augments value when creating callback.

Author

Boris Tomic <boris.tomic@zg.tel.hr>

This pages are under constant construction. Last change on 17.01.2002.