|
Nokia N97 SDK Example Applications Guide |
1. About this Example
2. Prerequisites
3. Architecture and Design
The use of Glib event sources by Symbian UI-based applications therefore requires that somehow Glib event sources should also be scheduled in the context of the Active Scheduler.
In this example, a special active object is created and added to the active scheduler. The active object, once started (see COpenCHelloGlibEventExHandler::Start()), schedules itself based on a simple timer service. In the COpenCHelloGlibEventExHandler::RunL() function, this active object simply runs one non-blocking iteration of the Glib event loop, and reschedules itself.
In this way, Active Objects as well as Glib event sources get handled in the same thread without blocking each other. This is demonstrated in the example by creating a Glib Timeout Source (see COpenCHelloGlibEventExUi::ConstructL()) of 1000 milliseconds, and modifying the text message displayed by the view in the callback function of the the timeout source (see timeout_cb). The Glib events do not affect the Active Objects used by the Symbian UI framework, and the UI event handling and redrawing happens as before.
|
© Nokia 2009 |