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).
- Readers' Choice Awards 2013
- Mars Needs Women
- IBM Will Minimize Impact of Future Disasters
- Sublime Text: One Editor to Rule Them All?
- December 2013 Issue of Linux Journal: Readers' Choice
- Raspberry Pi: the Perfect Home Server
- RSS Feeds
- Tech Tip: Really Simple HTTP Server with Python
- Linux Systems Administrator
- Web Administration Scripts
- Mixtapes Community
4 hours 54 min ago
- KDE is one true DE
5 hours 28 min ago
- Command Line Shells (Bash, Zsh, etc.) are 2nd place
5 hours 57 min ago
7 hours 52 min ago
- yes it's Jupiter Broadcasting
9 hours 11 min ago
- nice to see PClinuxOS finally
11 hours 45 min ago
- Personally, I am no longer a
12 hours 42 min ago
- It's Jupiter
1 day 3 hours ago
- GIMP is certainly a graphic
1 day 4 hours ago
- Thanks For Your Sharing
1 day 8 hours ago