Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.windows.x.intrinsics Frequently Asked Questions (FAQ)
Section - 40. Why does XtGetValues not work for me (sic)?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: comp.windows.x.intrinsics Frequently Asked Questions (FAQ)
Previous Document: 39.!What is this link problem with _get_wmShellWidgetClass, XtInherit?
Next Document: 41. Is this a memory leak in the X11R4 XtDestroyWidget()?!
See reader questions & answers on this topic! - Help others by sharing your knowledge
----------------------------------------------------------------------

The XtGetValues interface for retrieving resources from a widget is
sensitive to the type of variable. Your code may be doing something like this:

	{
	Arg args[3];
	int i;
	int sensitive;		/* oops; wrong data type */
	i=0;
	XtSetArg (args[i], XtNsensitive, &sensitive); i++;
	XtGetValues(widget, args, i );
	...
	}

But XtNsensitive is a Boolean, which on most machines is a single byte; 
declaring the variable "sensitive" as Boolean works properly. This problem 
comes up often when using particular toolkits that redefine the Xt types 
Dimension and Position; code that assumes they are int will have similar 
problems if those types are actually short. In general: you are safe if you
use the actual type of the resource, as it appears in the widget's man page.
[11/90]

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA