[comp.windows.x] NameFromWidget ? Actions ?

Jean-Christophe.Dhellemmes@MAPS.CS.CMU.EDU (05/30/90)

Thanks to those who answered my question about undefined XShape...
functions.  I hadn't modified my makefile to link my programs with the extra
-lXext library. My mistake...

An other problem (functional, this time) occured when I switched from R3 to
R4. It seems that events or translation actions have a different behavior.
In particular, the Enterwindow and Leavewindow events, and I suspect also a
strange behavior with the Btn2 actions.

While I was trying to understand what was going on, I wanted to retrieve a
widget name from the widget variable. I know about macros like XtClass or
XtParent, but nothing about a "XtName". What I want to do is printf the name
of the widget (as mentioned when the Widget is created) which is passed as
an argument to an action function. The problem is that the creation name is
not part of the ressources and cannot be retrieved with a XtGetValue.
Anybody knows how to do that ?

That was my first question. Now, I would like to understand better what are
the events generated for certain widgets, and how events are directed to
widgets when an action has to be taken. Take the following case, when a
specific menu (M) pops up when the cursor (c) is inside a given button (B):


		+-------------+
		|             |
		|  B +---------------+
		|    |  c            |
		+----|               |
		     |  |            |
		     |  |            |
	TOP	     |  |   M        |
		     |  |            |
		     |  V            |
		     |               |
		     |  c'           |
		     |               |
		     |               |
		     |               |
		     +---------------+

(B) has actions associated to <EnterWindow>, <LeaveWindow>, and <Btn2Down>.
(M) has actions associated to <Btn2Up>.
(TOP) has actions associated to <Btn2Down>.

1) When in position (c) is a Btn2Down event sent to both TOP and B ?
2) When (M) pops up, does it receive a <EnterWindow> event ?
3) When (M) pops up, does (B) receive a <LeaveWindow> event ?
4) When the cursor moves from (c) to (c') with (M) poped up, does (B) 
    receive a <LeaveWindow> event ?
5) When (M) pops down with cursor at (c), does (B) receive a <EnterWindow>
   event ?
6) When (M) pops down with cursor at (c'), does (B) receive a <LeaveWindow>
   event ?

Where can I find this information ? Is there a way to control the settings ?
Is there a way to chose whether only the last child or all the parents
receives an event ?

Thanks in advance for your help.
							* JCD

meo@rsiatl.UUCP (Miles ONeal) (06/01/90)

------------------------XtNmFrW.c------------------------
/*
	This belongs in the Commonly Asked Questions
   Guide For Xt Programmers... - meo
*/

#include <X11/CoreP.h>

char *XtNameFromWidget (W)

Widget W;
{
	return W->core.name;
}
---------------------------------------------------------