[Previous] [Contents] [Index] [Next]

AwMessage

PhAB message widget

Class hierarchy:

PtWidget --> AwMessage

For more information, see the diagram of the widget hierarchy.

PhAB icon:

None - instantiated by PhAB's Message module.

Public header:

<photon/AwMessage.h>

Description:

AwMessage displays a text-based message in a popup window. The message can include up to three optional buttons, allowing the user to select a course of action.


AwMessage widget


An AwMessage widget.


AwMessage is a PhAB widget. A PhAB widget uses one or more PhAB modules files as input and can be used only in an application built with PhAB. It's accessible in the Other module list when creating modules for your application.


Note: This widget is very similar to PtMessage and PtMessage is much easier to work with. It's primarily here for historical reasons and we highly recommend using PtMessage instead.

New resources:

Resource C type Pt type Default
Aw_ARG_MSG_BUTTON1 char * String "Ok"
Aw_ARG_MSG_BUTTON2 char * String NULL
Aw_ARG_MSG_BUTTON3 char * String NULL
Aw_ARG_MSG_DEFAULT short Scalar 1
Aw_ARG_MSG_FONT char * String "helv12"
Aw_ARG_MSG_TEXT char * String NULL
Aw_ARG_MSG_TITLE char * String NULL
Aw_CB_MSG_BUTTON1 PtCallback_t * Link NULL
Aw_CB_MSG_BUTTON2 PtCallback_t * Link NULL
Aw_CB_MSG_BUTTON3 PtCallback_t * Link NULL

Aw_ARG_MSG_BUTTON1, Aw_ARG_MSG_BUTTON2, Aw_ARG_MSG_BUTTON3

C type Pt type Default
char * String See below

The labels for the three optional buttons that are displayed below the message. If no label is provided for Aw_ARG_MSG_BUTTON1, the default of Ok is used. If no label is provided for the other two buttons, they default to NULL, which means they won't be displayed. These defaults are useful for messages that simply provide information.


Three-button usage


A typical AwMessage widget with three buttons.


You can assign a keyboard shortcut to each button. Simply place & in front of the character that will act as the shortcut. For example, if you specify &Save, the S will be underlined in the button. To select the button, the user can press s or S.


Note: The function PtAskQuestion() duplicates the functionality of the above example.

Aw_ARG_MSG_DEFAULT

C type Pt type Default
short Scalar 1

The number of the default button (1, 2 or 3), which can be selected by pressing Enter. The default button is initially given focus.

Aw_ARG_MSG_FONT

C type Pt type Default
char * String "helv12"

The font in which the message will be displayed (12-point Helvetica by default).

Aw_ARG_MSG_TEXT

C type Pt type Default
char * String NULL

The message to be displayed.

Aw_ARG_MSG_TITLE

C type Pt type Default
char * String NULL

An optional title for the window frame of the message. Defaults to NULL for no title.

Aw_CB_MSG_BUTTON1, Aw_CB_MSG_BUTTON2, Aw_CB_MSG_BUTTON3

C type Pt type Default
PtCallback_t * Link NULL

Callback functions that will be invoked if the user selects one of the buttons. These resources correspond with the buttons by number. So, for example, if the user selects the button labeled with Aw_ARG_MSG_BUTTON1, Aw_CB_MSG_BUTTON1 is invoked.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
The name of the callback resource (e.g. Aw_CB_MSG_BUTTON1) that caused this callback to be invoked.
reason_subtype
0 (not used).
event
The raw event that caused the the callback to be invoked.
cbdata
Always NULL for this widget.

These callbacks should return Pt_CONTINUE.

Inherited resources:

This widget is self-contained and doesn't use any resources inherited from PtWidget.


[Previous] [Contents] [Index] [Next]