Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!quanta.eng.ohio-state.edu!kcgl1.eng.ohio-state.edu!DAVISM From: DAVISM@kcgl1.eng.ohio-state.edu (Michael T. Davis) Newsgroups: comp.windows.x Subject: Re: Problem with Dwt List Box (callback data) Message-ID: <3045@quanta.eng.ohio-state.edu> Date: 15 Sep 89 20:02:07 GMT References: <3035@quanta.eng.ohio-state.edu> Sender: news@quanta.eng.ohio-state.edu Organization: Ohio State University Lines: 66 In article <3035@quanta.eng.ohio-state.edu>, I wrote: > > I am experiencing a problrm with the callback data structure passed >to my callback function for a DECwindows Toolkit (Dwt) List Box widget. I >am running DECwindows under VMS 5.1-B on a VAXstation 3100. Here's the >List Box set up code: > >[list box setup deleted] > >And here's the callback: > >void list_callback ( widget, user_data, callback_data ) > Widget * widget; > caddr_t user_data; > DwtListBoxCallbackStruct callback_data; >[body of callback deleted] > >The reason member and item_length of the callback data structure always have >bogus values in them and the item_number member is always 0. All the structure >members stay constant, no matter which item I select with the pointer. Is >there something really obvious I am forgetting, or what? As it turns out, the copy of the DECwindows docs we have lays out the parameters to the callback exactly as I have them above. In fact, the widget should be passed by value and the callback_data should be passed by reference. All is well with the List Box now. But here's another problem... Within the same application, I want to create a Push Button which the user can "press" and activate a callback. Here's the setup code: push_button = DwtPushButton ( main_window, "Cancel Button", 30, 175, DwtLatin1String ( "Cancel" ), NULL, NULL ); XtAddCallback ( push_button, DwtNactivateCallback, cancel_callback, NULL ); XtSetArg ( settings [ 0 ], DwtNconformToText, True ); XtSetValues ( push_button, settings, 1 ); XtManageChild ( push_button ); And here's the callback: static void cancel_callback ( widget, user_data, callback_data ) Widget widget; caddr_t user_data, callback_data; { parse_verb ( & 0 ); /* parse_verb is FORTRAN code, so need to pass integer value by reference */ } The main_window (parent) is a Dialog Box. I have two other children in the Dialog Box, the aforementioned List Box and a Label. The problem is that the push button never appears. I don't get any errors, but I don't see a Push Button either. Any ideas? Thanks, Mike ________________________________________________________________________ | InterNet> davism@{kcgl1.eng|rcgl1.eng|osu-20.ircc}.ohio-state.edu | | -or- | | davis-m@eng.ohio-state.edu | | CompuServe> 73667,541 | |************************************************************************| | These thoughts, they be mine | ------------------------------------------------------------------------