sean@hightop.eos.scg.hac.com (11/07/90)
I was trying to pass a list of widgets into a callback but I ran into pointer
problems. Inside the callback I tried to XtUnmanageChild the widgets, change
some values, and XtManageChild the widgets. I would either get a segentation or
bus error at the first unmanageing or manageing the widgets. I tried to set up
the widget list data structutre in several ways. The latest looked like:
typedef struct widget_list widget_list_s;
struct widget_list {
Widget heading_widget;
Widget data_widget;
Widget form_widget;
};
The initialization looked like:
Widget orderSummaryForm;
Widget orderItemDataList;
Widget orderItemHeadingList;
widget_list_s list_widgets;
.
.
.
list_widgets.heading_widget = orderItemHeadingList;
list_widgets.data_widget = orderItemDataList;
list_widgets.form_widget = orderSummaryForm;
The callback looked like:
void
AOSMedia(w, client, call)
Widget w;
widget_list_s client;
XmAnyCallbackStruct *call;
{
Arg args[2];
int argcnt;
XtUnmanageChild(client.orderItemDataList);
XtUnmanageChild(client.orderItemHeadingList);
XtUnmanageChild(client.orderSummaryForm);
argcnt = 0;
XtSetArg(args[argcnt], XmNwidth, 1130); argcnt++;
XtSetValues(orderSummaryForm, args, argcnt);
XtManageChild(orderMediaDataList);
XtManageChild(orderMediaHeadingList);
XtManageChild(orderSummaryForm);
}
What am I doing wrong. I saw a reference to something called WidgetList in the
XtIntrinsics Reference Manual on XtUnmanageChildren but I couldn't find how
you initialize the widget list. Thanks in advance.