Fedora 13, 2.6.33.5-112.fc13.x86_64 XmList fc_list; XtCallActionProc(fc_list, "ListNextItem",NULL,NULL,0); Compiles without complaint, but does not work and causes a core dump. Some other action routines work, such as ListEndData(). These seem to work in Lesstif. |
|||

fredk
You must pass a pointer to a
You must pass a pointer to a valid event as the third argument, since List's ListNextEvent() method dereferences it. You pass NULL, and hence the crash.
Lesstif is not Motif; if it works under Lesstif it means that Lesstif's method does not dereference the event parameter.
--
Fred K.
CrystalCowboy
From the manual: "If the
From the manual: "If the named action routine cannot be found, XtCallActionProc generates a warning message and returns."
That doesn't sound quite the same as "If the named action routine cannot be found, XtCallActionProc will blow up your application and dump core."
fredk
No warning message was
No warning message was generated because the action routine WAS found. Your app crashed because during the execution of the action routine it tried to use the event passed to it, but you passed NULL. You need to pass it a pointer to a valid event instance.