[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

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

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)?


157) How do I determine the name of an existing widget?


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]



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 October 22 2009 @ 05:36 AM

Some parts © 2009 Advameg, Inc.