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 Frequently Asked Questions (FAQ) 7/7
Section - 157) How do I determine the name of an existing widget?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Sex offenders ]


Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 156) How do I query the user synchronously using Xt?
Next Document: 158) Why do I get a BadDrawable error drawing to XtWindow(widget)?
See reader questions & answers on this topic! - Help others by sharing your knowledge
I have a widget ID and need to know what the name of that widget is.

	Users of R4 and later are best off using the XtName() function, which 
will work on both widgets and non-widget objects.

	If you are still using R3, you can use this simple bit of code to do 
what you want. Note that it depends on the widget's internal data structures 
and is not necessarily portable to future versions of Xt, including R4.

	#include <X11/CoreP.h>
	#include <X11/Xresource.h>
	String XtName (widget)
	Widget widget;	/* WILL work with non-widget objects */
	{
	return XrmNameToString(widget->core.xrm_name);
	}

[7/90; modified with suggestion by Larry Rogers (larry@boris.webo.dg.com) 9/91]

User Contributions:

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




Top Document: comp.windows.x Frequently Asked Questions (FAQ) 7/7
Previous Document: 156) How do I query the user synchronously using Xt?
Next Document: 158) Why do I get a BadDrawable error drawing to XtWindow(widget)?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
faq%craft@uunet.uu.net (X FAQ maintenance address)





Last Update March 27 2014 @ 02:12 PM