|
| | Callback () |
| |
| | Callback (std::function< void(void)> function) |
| | Create a callback from a function, e.g., GuiControl::Callback(&printWarning) More...
|
| |
| template<class Class > |
| | Callback (Class *const object, void(Class::*method)()) |
| | Create a callback from a class and method of no arguments, e.g., App* app = ...; Callback( app, &App::endProgram ); . More...
|
| |
| template<class Class > |
| | Callback (const shared_ptr< Class > &object, void(Class::*method)()) |
| | Create a callback from a reference counted class and method of no arguments, e.g.,. More...
|
| |
| | Callback (const Callback &c) |
| | Copy constructor. More...
|
| |
| virtual void | execute () |
| | Execute the callback. More...
|
| |
| Callback & | operator= (const Callback &c) |
| | Assignment. More...
|
| |
Base class for GuiButton pre-event handlers.
You may subclass this and override execute or simply use one of the provided constructors.
template<class Class >
| G3D::GuiControl::Callback::Callback |
( |
Class *const |
object, |
|
|
void(Class::*)() |
method |
|
) |
| |
|
inline |
Create a callback from a class and method of no arguments, e.g., App* app = ...; Callback( app, &App::endProgram ); .
If the method is defined on a base class and not overriden in the derived class, you must cast the pointer: Callback(static_cast<Base*>(ptr), &Base::method);