Path: utzoo!censor!geac!jtsv16!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!hpfclp!diamant From: diamant@hpfclp.SDE.HP.COM (John Diamant) Newsgroups: comp.windows.x Subject: Re: How can I find the name of an HP widget? Message-ID: <9740096@hpfclp.SDE.HP.COM> Date: 1 Aug 89 05:31:58 GMT References: <8907290110.AA10305@prometheus.think.com> Organization: HP SESD, Fort Collins, CO Lines: 20 > I tried XtNname with no luck, and I even printed out the entire resource > list of the widget, but the name isn't there! How can that be? I even > looked in the source, but all I can find are private fields like xrm_name > that I can't get at. So how do I get the widget name? Unfortunately, the Xt Intrinsics (R2 at least) don't provide a public way to get a widget's name. The easiest way to get it is to cheat, and pull it out of the private part of the widget data structure (break the object oriented data hiding) by writing a function that reads the name field out of the core part of the widget structure. The way to do that is to include in your file and then reference the private fields directly. Since this isn't a good idea in general, you might just want to place your function in it's own source file, so only that function has access to the private structures. John Diamant Software Engineering Systems Division Hewlett-Packard Co. Internet: diamant@hpfclp.sde.hp.com Fort Collins, CO UUCP: {hplabs,hpfcla}!hpfclp!diamant