PhAB message widget
PtWidget --> AwMessage
For more information, see the diagram of the widget hierarchy.
None - instantiated by PhAB's Message module.
<photon/AwMessage.h>
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.
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.
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. |
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 |
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.
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.
The function PtAskQuestion() duplicates the functionality of the above example. |
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.
C type | Pt type | Default |
---|---|---|
char * | String | "helv12" |
The font in which the message will be displayed (12-point Helvetica by default).
C type | Pt type | Default |
---|---|---|
char * | String | NULL |
The message to be displayed.
C type | Pt type | Default |
---|---|---|
char * | String | NULL |
An optional title for the window frame of the message. Defaults to NULL for no title.
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:
These callbacks should return Pt_CONTINUE.
This widget is self-contained and doesn't use any resources inherited from PtWidget.