Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!ben From: ben@hpcvlx.HP.COM (Benjamin Ellsworth) Newsgroups: comp.windows.x Subject: Re: widget name Message-ID: <100920081@hpcvlx.HP.COM> Date: 9 Jun 89 17:00:45 GMT References: <1937@aucs.UUCP> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 45 > How do I get the name which was used in creating an HP widget later > on in the program? It's hard. IMHO it is a hole in the Xt functionality. > I'm guessing that it's possible using XtGetValues... Keep guessing. If I had to do it I would: 1- In a separate file include IntrinsicP.h and write a function char * XtName(w) Widget w; { return(w->core.name); /* Or you could malloc and copy... */ } 2- Make that file into a .o and link with it. Yeah, it's a somewhat cluttered approach, but when the Intrinsics support the functionality all you have to do is throw away one file and change your link line. >Any help will be appreciated. Small unmarked bills are best... ;-) > (A more general question is, How should I associate extra data with a > widget, and later access it?). Not easy to do if you want to attach it to the widget structure itself. In R3 you could take over the extension field, but you might get clobbered later. I think that I would use the Xrm database. ----------------------------------------------------------------------- Benjamin Ellsworth | ben@cv.hp.com | INTERNET Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP 1000 N.E. Circle | (USA) (503) 750-4980 | FAX Corvallis, OR 97330 | (USA) (503) 757-2000 | VOICE ----------------------------------------------------------------------- All relevant disclaimers apply. -----------------------------------------------------------------------