Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!cory.Berkeley.EDU!dheller From: dheller@cory.Berkeley.EDU (Dan Heller) Newsgroups: comp.windows.x Subject: Widget writing: XtGetValues() Message-ID: <4859@pasteur.Berkeley.EDU> Date: 5 Aug 88 06:56:53 GMT Sender: news@pasteur.Berkeley.EDU Reply-To: dheller@cory.Berkeley.EDU (Dan Heller) Organization: University of California, Berkeley Lines: 24 I've been having a problem with XtGetValues actually getting some of my widget's values when called. For exmple, I would create a widget which has a char * field in it to represent a fairly dynamic string (e.g. its value changes rather frequently). I want to get the value of the string, so I call: Arg arg; char buf[SIZE]; XtSetArg(arg, XtNstring, buf); XtGetValues(widget, &arg, ONE); However, the buffer never gets filled with the value of the string. The funny thing is, this doesn't happen all the time -- some fields of the widget can be gotten just fine. I haven't been able to determine a pattern yet. A logical asumption at this time is that I shouldn't expect XtGetValues to strcpy() the value into the buffer, but rather to just set the value of the pointer passed to the value of the pointer of the char *. That means I'd have to pass the address of a char * variable. But this doesn't explain why it's not working for other variables. The only workaround I've found is to write a get_values_hook function, test the "name" attributes and set the "values" by hand. But this seems like it shouldn't be necessary. Dan Heller