Callbacks are used to supply information to the user on the events (graphic or not) managed by the widget.
XmNlocatorCallback
This callback is used to return locator-type information (WC coordinates) in a callback.
NB : Locator information is also available in the PHIGS events file, if the locator has been initialised in Event mode (pinit_loc), and is available with the PHIGS function pget_loc(). This is only true if the widget is used with the PIM and not the PIMM (%mi no).
The returned structure is :
typedef struct {
int wsid;
int GPhigsViewIndex;
Ppoint GPhigsLocator;
XButtonEvent *GPhigsEvent;
} XmGPhigsLocatorStruct
XmNlocatorSampleCallback
This callback is used to return locator-type information in a callback continuously, i.e. by simulating PHIGS sample mode.
The returned structure is :
typedef struct {
int wsid;
int GPhigsViewIndex;
Ppoint GPhigsLocator;
XButtonEvent *GPhigsEvent;
} XmGPhigsLocatorStruct
See demonstration program MtstPR.c
XmNpickCallback
This callback is used to return pick-type information in a callback.
NB : Pick information is also available in the PHIGS events file, if pick has been initialised in Event mode (pinit_pick), and is available with the PHIGS function pget_pk(). This is only true if the widget is used with the PIM and not the PIMM (%mi no).
The returned structure is :
typedef struct {
int wsid;
Pin_status GPhigsStatus;
Ppick_path GPhigsPick;
XButtonEvent *GPhigsEvent;
} XmGPhigsPickStruct
XmNpickSampleCallback
This callback is used to return pick-type information continuously, in a callback, i.e. by simulating PHIGS sample mode.
The returned structure is :
typedef struct {
int wsid;
Pin_status GPhigsStatus;
Ppick_path GPhigsPick;
XButtonEvent *GPhigsEvent;
} XmGPhigsPickStruct
See demonstration program ChoiceLcW.c
XmNchoiceCallback
This callback is used to access the button number clicked by the user or the keyboard function key.
The returned structure is :
typdef struct {
int reason;
KeySym keysym;
int keynum;
int wsid;
int mouseButton;
char GPhigsKey;
union {
XKeyPressedEvent *GPhigsChoiceKeyEvent;
XButtonPressedEvent *GPhigsChoiceButtonEvent;
} GPhigsChoiceEvent;
} XmGPhigsChoiceStruct;
reason : XmCR_MOUSE_IN_WS / XmCR_KEY_IN_WS
See demonstration program ChoiceLcW.c
XmNcreateDACallback
This callback, which is only called once , informs the user that the GPHIGS widget is mapped (on the screen), and that it is therefore possible, as of that moment, to plot graphics. Since the client-server function mode of Xwindow is asynchronous, it is impossible to know in advance when an event is arriving, in particular when a window will be mapped. Since the PHIGS plot can only be drawn when the window is active on the screen, this callback resolves the problem.
Particularly, it enables an application to be loaded with a graphic inside as soon as the window is displayed on the screen, . Without this callback you must wait until the window is mapped (on the screen) before pressing a button to start plotting the graphics. To solve the problem, place the CSS construction and a PHIGS redraw order in this callback.
XmNexposeDACallback
This callback allows the user to redefine widget default behavior for expose-type events in the graphic zone.
XmNresizeDACallback
This callback allows the user to redefine widget default behaviour for resize type events in the graphic zone.
XmNmotionCallback
This callback enables the user to retrieve coordinates during moves in the graphic window.
The returned structure is :
typedef struct {
int wsid;
int device;
XButtonEvent *buttonEvent;
int win_width;
int win_height;
int screen_width;
int screen_height;
} XmGPhigsMotionStruct;
XmNstringCallback
This resource enables the user to retrieve the string of characters entered in the graphic window.
The returned structure is :
typedef struct {
int wsid;
int reason;
char string[2048];
} XmGPhigsStringStruct;
reason : XmCR_NOTHING_IN_WS
XmCR_STRING_IN_WS
XmNpickLocCallback
This resource enables the user to retrieve pick and locator actions.
The returned structure is :
typedef struct {
int wsid;
Pin_status GPhigsStatus;
Ppick_path GPhigsPick;
Pint viewIndex;
Ppoint3 point3;
XButtonEvent *GPhigsEvent;
} XmGPhigsPickLocStruct