Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!uhccux!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!gnb From: gnb@bby.oz.au (Gregory N. Bond) Newsgroups: comp.windows.x Subject: Re: widget name -> widget Message-ID: Date: 11 Apr 91 07:22:47 GMT References: <1991Apr10.003309.10438@marlin.jcu.edu.au> <1991Apr10.161839.3589@sj.nec.com> Sender: usenet@melba.bby.oz.au (news READER id) Organization: Burdett, Buckeridge and Young Ltd. Lines: 25 In-Reply-To: achan@sparkle.nec.com's message of 10 Apr 91 16:18:39 GMT Nntp-Posting-Host: leo-gw >>>>> On 10 Apr 91 16:18:39 GMT, achan@sparkle.nec.com (Amy Chan) said: Amy> You can also use the function XtNameToWidget to get the widget ID Amy> for the specified widget instance name. A gotcha with this: It only succeeds on children that are real, fairdinkum managed children of a composite widget - I assume because it looks at the composite.num_children and composite.children fields. Some widgets have "hidden" children that are XtCreate'd but not managed (composite dialog boxes, sources or sinks for text widgets etc) where the pointer to the child widget is stored somewhere in the parent widget instance record. XtNameToWidget cannot find these. A consequence of this is that Wcl (which uses XtNameToWidget internally) cannot use the WcSetValueCB callback to set their resources. (I noticed this on the AtPlotter widget where the axes are hidden widgets. I have a fix for this - make them managed children!) Greg. -- Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia Internet: gnb@melba.bby.oz.au non-MX: gnb%melba.bby.oz@uunet.uu.net Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb