NAME
FLTK::AssociationType - Base class for the association type
Description
Base class for the association type.
FLTK allows you to attach any kind of user data to a widget. This data is automatically freed when the widget to which it is attached is destroyed. Internally an association table is used to connect the widget pointer with the data pointer that is why all the functions concerned with this feature contain "association" in their name. The advantage of this is that no space is taken on widgets that do not contain the data (or that have the "default value"), and that the destructor code is not linked in if the association is not used.
To be able to associate data and to be able to have a customized way of freeing the data you need to derive from this class and then create an instance of that class. With the pointer to that instance the type of the data is identified.
possible uses:
- assign key shortcuts to certain widgets
- assign a tooltip to some widgets
- assign a help-index to widgets
- assign a unique identifier to widgets to remote controlling
- assign additional layouting data for new container widgets
- assign data needed by typesafe callback mechanisms
- assign all kind of data not always required within a widget / each widget
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
License and Legal
Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.