Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Signals & Slots

Overview

The CPLAT_MacOS framework uses signals and slots to provide inter object communication and simply the process of handling events and commands.

Objects that are derived from CP_Object inherit the ability to provide for registration of signal and slots by names so you can later find the signal or slot by identifier.

So for example, you need to connect to a buttons clicked signal, you would do the following:

            // push button
        viewLocation.Set( 10, 20 );
        viewSize.Set( 150, 20 );
        title = "Pushbutton";
        pushButtonOne = CP_new CPLAT_MacOS::CP_PushButton( returnView, viewLocation, viewSize, title, kCP_PushButtonClickedCommand );
        pushButtonOne->FindSignal( kCP_Signal_Clicked )->connect( CPLAT_MacOS::CP_SigSlot::slot(this, &CP_UIClasses_Application::ControlClicked) );

This example, taken from the CP_UIClasses demo shows the creation of a Push Button, and then a slot to be called whenever the user clicks on the button is connected by finding the buttons Clicked signal. You can see this in action by running the CP_UIClasses demo.


Generated on Tue Sep 20 20:22:25 2005 for CPLAT_MacOS by  doxygen 1.4.0