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 - Internet FAQ Archives Frequently Asked Questions (FAQ)
Section - 29.!How can I identify the children of a manager widget?

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Airports ]

Top Document: Frequently Asked Questions (FAQ)
Previous Document: 28. How can I add a C++ member function as a widget callback?
Next Document: 30. Can I use XtMoveWidget(), ... to move widgets I created?
See reader questions & answers on this topic! - Help others by sharing your knowledge

Use XtGetValues() on XtNchildren (array of widget IDs) and
XtNnumChildren (number of widgets in array).

	Widget		*children = NULL;
	Cardinal	count = 0;
	Arg		args[10];
	Cardinal	cnt;

	cnt = 0;
	XtSetArg (args[cnt], XtNchildren, &children); ++cnt;
	XtSetArg (args[cnt], XtNnumChildren, &count); ++cnt;
	XtGetValues (widget, args, cnt);

NOTE: This does not get the list of popup children.  One must access
the private members of Core to do so.

NOTE: The children may not be valid if the user is destroying widgets,
as the children may be only at phase 1 of the destroy.  So if they
destroy a child and then get the count before the child is Phase 2'd,
then it will show up -- and is probably not what most people want.

User Contributions:

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