Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!kiwi!mprgate!baker From: baker@mprgate.mpr.ca (Sue Baker) Newsgroups: comp.windows.x.motif Subject: trouble with structures and callbacks Message-ID: <2450@kiwi.mpr.ca> Date: 23 Nov 90 00:08:06 GMT Sender: news@eric.mpr.ca Reply-To: baker@mprgate.mpr.ca (Sue Baker) Organization: MPR Teltech Ltd. Lines: 33 i'm trying to pass a structure as client_data to a callback function, and am achieving nothing but frustration. i am working with text widgets making up a user entry screen, and want to convert all of the user's responses to strings using multiple calls to XmTextGetString() when the user clicks on the "update" button. the simple structure is like: struct widget_type{ /* more detail to be added */ Widget widget_array[4]; }; /* to structure later */ then variable "text" is: struct widget_type text; i then generate an array of text widgets in text.widget_array i add a callback to my "update" button: XtAddCallback(update, XmNactivateCallback, get_text, text); within the "get_text" function, i receive "text" as "textwidget" and i can access textwidget.widget_array[0] with no trouble, but i get a segmentation fault when i try to access any other element of textwidget.widget_array. so, 1) why can't i access my structure in this manner? 2) how can i make my structure accessible to my callback function? thank you in advance for any help in this matter. sue baker@mprgate.mpr.ca