![]()  | 
![]()  | 
![]()  | 
![]()  | 
![]()  | 
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. | 
Display a message and request a response
int PtAlert( PtWidget_t *parent,
             PhPoint_t const *location,
             char const *title,
             PhImage_t const *image,
             char const *message,
             char const *msgFont,
             int btnCount,
             char const **buttons,
             char const **btnFonts,
             int defBtn,
             int escBtn,
             int flags );
All button-text arguments let you define shortcut keys. Place an ampersand (&) in front of the character that you want to be the shortcut. For example, if you specify &Yes, the Y is underlined in the button, and you can select the button by pressing y or Y.
with any combination of the following:
Pt_BLOCK_ALL overrides Pt_BLOCK_PARENT.
ph
This function displays a dialog that displays a message and contains any number of buttons so that you can respond.

A sample dialog displayed by PtAlert().
The number of the button that you selected.
char const *btns[] = { "&Save it", "&Discard changes",
                       "&Cancel" };
char Helvetica14[MAX_FONT_TAG];
switch( PtAlert( base_wgt, NULL, "File Not Saved", NULL,
           "The file hasn't been saved.\n\
What do you want to do with it?",
           PfGenerateFontName("Helvetica", 0, 14,
                              Helvetica14),
           3, btns, NULL, 1, 3, Pt_BLOCK_ALL ) ) {
    case 1:
        /* save */ 
        break; 
    case 2:
        /* discard changes */
        break;
    case 3:
        /* cancel */
        return; 
}
Photon
| Safety: | |
|---|---|
| Interrupt handler | No | 
| Signal handler | No | 
| Thread | No | 
ApError(), PfGenerateFontName(), PhImage_t, PhPoint_t, PtNotice(), PtPassword(), PtPrompt()
"Dialog modules" in the Working with Modules chapter of the Photon Programmer's Guide
![]()  | 
![]()  | 
![]()  | 
![]()  |