Hooking code up to when the Window is shown by the toolbox

The window will be automatically shown by the toolbox when the user clicks on the iconbar. We have to detect this so we can add our event handling and set variables for the gadgets on the window. In this example we have a class called Reverser that does this. The following code snippet is from the main function that does this.

 // A class to control the main window
 Reverser reverser;

 // Link the class to the "reverse" toolbox window when it is created
 my_app.set_autocreate_listener("reverse", &reverser);

Now when the "reverse" toolbox object is created the auto_created method will be called on the reverser C++ object.