Certain problems arise when a graphic animation in a MOTIF program is required. When the program is loaded into the Mainloop, the only way to perform the animation is to loop it in a callback. However, the mainloop is then no longer active and Mainloop is blocked until the end of the animation.

MainLoop does not have control while the animation is running and does not process X events.
To resolve this problem, the GPHIGS_GUI toolkit is equipped with a specific function, GPHIGS_ANIM_CB.
This function must be called during a callback.
For example, animation activation via a pushButton
XtAddCallBack(w, XmNactivateCallback, GPHIGS_ANIM_CB, fctUser) w pushButton widget XmNactivateCallback push button's callback fctUser user function which performs the animation
This function (fctUser) only performs a single animation step.
The first press on the pushbutton activates the animation, the second inactivates it. This operation may be repeated as often as required.
See demonstration program MHLSDB.c