Issue with XmCreateOptionMenu -> XmCreatePulldownMenu -> XmCreatePushButton

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Issue with XmCreateOptionMenu -> XmCreatePulldownMenu -> XmCreatePushButton

 

Hi Motif Developers,

If you could please help with the following query this would be much appreciated.

I'm running a large and complex motif system on linux, originally developed about 10 years ago for HP-UX, which works fine apart from the following issue -

There is some code as follows -

...
XtSetArg(args[ac], XmNx, 300); ac++;
XtSetArg(args[ac], XmNy, 10); ac++;
XtSetArg(args[ac], XmNwidth, 240); ac++;
XtSetArg(args[ac], XmNheight, 30); ac++;
wMO = XmCreateOptionMenu(wOption1, "wMO", args, ac);
XtManageChild(wMO);

ac = 0;
XtSetArg(args[ac], XmNx, 0); ac++;
XtSetArg(args[ac], XmNy, 0); ac++;
XtSetArg(args[ac], XmNwidth, 100); ac++;
XtSetArg(args[ac], XmNheight, 300); ac++;
wMD = XmCreatePulldownMenu(XtParent(wMO), "wMD", args, ac);

ac = 0;
XtSetArg(args[ac], XmNuserData, eEnumValue); ac++;
wBP1 = XmCreatePushButton(wMD, "wBP1", args, ac);
XtManageChild(wBP1);

ac = 0;
XtSetArg(args[ac], XmNuserData, eEnumValue); ac++;
wBP2 = XmCreatePushButton(wMD, "wBP2", args, ac);
XtManageChild(wBP2);

ac = 0;
XtSetArg(args[ac], XmNuserData, eEnumValue); ac++;
wBP3 = XmCreatePushButton(wMD, "wBP3", args, ac);
XtManageChild(wBP3);

Immediately after this, the code does an XtVaGetValues on XmNchildren, to get a WidgetList of all the children of wImageMD, it returns null (rather than wBP1, etc). Also, confusingly, XtParent(wBP1) does appear to return the parent, namely wMD.

The code worked fine 10 years ago on the HP-UX system, but ultimately hits a fatal exception in our RHEL system, as further on in the code it's unable ofcourse to iterate through NULL.

Is there an easy fix to this, or does it necessitate a fundamental rethink of the whole object model? Might it be caused by a changed semantics to those motif calls over the last 10 years (our RHEL system has up-to-date motif libraries).

Any comments on this would be appreciated.

Regards,
Ze

 

 

Ze, I cannot find wImageMD

Ze,

I cannot find wImageMD declaration in your code, did you forget to insert appropriate part of code?