diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-B57ECD51-85EF-50EA-B3EE-62A85CD9C382.dita --- a/Symbian3/PDK/Source/GUID-B57ECD51-85EF-50EA-B3EE-62A85CD9C382.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-B57ECD51-85EF-50EA-B3EE-62A85CD9C382.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,68 +1,68 @@ - - - - - -How -to use a notifier to display a simple dialog, asynchronouslyProvides code snippets to show you how to use a notifier to display -a simple dialog asynchronously. -

To display a simple dialog box:

- -

When the user keys in one of the button characters, the requesting thread's request -semaphore is signalled to indicate that the notifier request is -complete. The TRequestStatus object supplied by the requesting -thread is set to KErrNone.

-

In addition, a TInt, passed by reference to Notify(), -is set to 0 or 1 depending on whether the first or the second button is selected.

-

The session is closed by calling the Close() member function -of the RNotifier.

-

The following code fragments demonstrate this:

-{ -_LIT(KTxtLine1,"First line"); -_LIT(KTxtLine2,"Second line"); -_LIT(KButt1,"a"); -_LIT(KButt2,"b"); -... -TInt whichbutton(-1); -TRequestStatus stat; -... -RNotifier notifier; -... -notifier.Connect(); -... -notifier.Notify(KTxtLine1,KTxtLine2,KButt1,KButt2,whichbutton,stat); -... -// other code -... -User::WaitForRequest(stat); -... -if (whichbutton==0) - { - // first button selected - } -if (whichbutton==1) - { - // Second button selected - } -... -notifier.Close(); -... -} -

Note that the descriptor parameters passed to Notify() must -remain in existence until the notify request completes; this may be some time -after the call to Notify() itself.

+ + + + + +How +to use a notifier to display a simple dialog, asynchronouslyProvides code snippets to show you how to use a notifier to display +a simple dialog asynchronously. +

To display a simple dialog box:

+
    +
  • construct an RNotifier object +and then call its Connect() member function to create a session +with the Notifier server.

  • +
  • call the Notify() member +function of the RNotifier, passing descriptors containing +the two lines of text to be displayed and the characters for the buttons. Notify() makes +an asynchronous request to the notifier server.

  • +
+

When the user keys in one of the button characters, the requesting thread's request +semaphore is signalled to indicate that the notifier request is +complete. The TRequestStatus object supplied by the requesting +thread is set to KErrNone.

+

In addition, a TInt, passed by reference to Notify(), +is set to 0 or 1 depending on whether the first or the second button is selected.

+

The session is closed by calling the Close() member function +of the RNotifier.

+

The following code fragments demonstrate this:

+{ +_LIT(KTxtLine1,"First line"); +_LIT(KTxtLine2,"Second line"); +_LIT(KButt1,"a"); +_LIT(KButt2,"b"); +... +TInt whichbutton(-1); +TRequestStatus stat; +... +RNotifier notifier; +... +notifier.Connect(); +... +notifier.Notify(KTxtLine1,KTxtLine2,KButt1,KButt2,whichbutton,stat); +... +// other code +... +User::WaitForRequest(stat); +... +if (whichbutton==0) + { + // first button selected + } +if (whichbutton==1) + { + // Second button selected + } +... +notifier.Close(); +... +} +

Note that the descriptor parameters passed to Notify() must +remain in existence until the notify request completes; this may be some time +after the call to Notify() itself.

\ No newline at end of file