Callback functions have the following format:
void functionNameCallback (Widget w, XtPointer client_data, XmPushButtonCallbackStruct *cbs)
The callback function parameters are:
The first parameter of the function is the widget associated with the function (button in our case).
The second parameter is used to pass client data to the function. It is not used in our sample program.
The third parameter is a pointer to a structure that contains data specific to the particular widget that called the function and information on the event that triggered the call. The structure we have used is a XmPushButtonCallbackStruct, since we are using the PushButton Widget.
This article was a mere introduction to the world of X/Motif programming. We've looked at a simple Motif program to introduce the basic concepts in building the graphical user interface. For more information, see Resources.
Ibrahim Haddad (email@example.com) is a Ph.D. student in the computer science department at Concordia University in Montréal, Canada. Ibrahim was first introduced to Linux (0.99) and Motif at the Lebanese American University. Among his interests are e-commerce, web applications, distributed objects and helping his friends at LinuxLeb.com (Linux Lebanon).
|Graph Any Data with Cacti!||Apr 27, 2017|
|Be Kind, Buffer!||Apr 26, 2017|
|Preparing Data for Machine Learning||Apr 25, 2017|
|openHAB||Apr 24, 2017|
|Omesh Tickoo and Ravi Iyer's Making Sense of Sensors (Apress)||Apr 21, 2017|
|Low Power Wireless: 6LoWPAN, IEEE802.15.4 and the Raspberry Pi||Apr 20, 2017|
- Graph Any Data with Cacti!
- Teradici's Cloud Access Platform: "Plug & Play" Cloud for the Enterprise
- Simple Server Hardening
- The Weather Outside Is Frightful (Or Is It?)
- Understanding Firewalld in Multi-Zone Configurations
- From vs. to + for Microsoft and Linux
- Gordon H. Williams' Making Things Smart (Maker Media, Inc.)
- Buddy Platform Limited's Parse on Buddy Service
- A Switch for Your RPi