Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!ncar!ames!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!fred
From: fred@hpcvlx.HP.COM (Fred Taft)
Newsgroups: comp.windows.x
Subject: Re: HP's Xtk Bug Fixes
Message-ID: <1610036@hpcvlx.HP.COM>
Date: 15 Aug 88 18:12:05 GMT
References: <1610032@hpcvlx.HP.COM>
Organization: Hewlett-Packard Co., Corvallis, OR, USA
Lines: 46

### bug number:   649
### area:         Xt
### severity:     low
### comments:     

VERSION:
	X Window System, Version 11, Release 2

AREA:
	Xt

SYNOPSIS:
	XtNameToWidget fails on primitives with popup children

DESCRIPTION:
	The XtNameToWidget function that translates a widget name 
        to a widget instance doesn't take into account a primitive 
        widget with popup childrens. This is used, for instance, with 
        the HP Widget set when using their menu manager, menu panels, etc...  

	Is the "if (!XtIsComposite(root)) return NULL;" to strong in 
        NameListToWidget?

FIX:

/* Patch to Intrinsic.c */

252d251
<     if (! XtIsComposite(root)) return NULL;
254,257c253,260
<     children = ((CompositeWidget) root)->composite.children;
<     for (i = 0; i < ((CompositeWidget) root)->composite.num_children; i++) {
< 	if (name == children[i]->core.xrm_name)
< 	    return NameListToWidget(children[i], &names[1]);
---
>     /* Check normal children only if this is a composite widget */
>     if (XtIsComposite(root))
>     {
>        children = ((CompositeWidget) root)->composite.children;
>        for (i = 0; i < ((CompositeWidget) root)->composite.num_children; i++) {
> 	   if (name == children[i]->core.xrm_name)
> 	       return NameListToWidget(children[i], &names[1]);
>        }
258a262,263
> 
>     /* Even non-composite widgets may have popup children */