Path: utzoo!attcan!uunet!ginosko!husc6!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: How can I find the name of an HP widget? Message-ID: <8907311514.AA14965@expo.lcs.mit.edu> Date: 31 Jul 89 15:14:41 GMT References: <8907290110.AA10305@prometheus.think.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 31 > 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? This is a hole in the R3 specification. There is no portable way to do this. We are busily working on the R4 specification and it will include a public function that will support a portable interface for retreiving the the name of a widget. Until then the only way to get the name of a widget is to include IntrinsicP.h and read the core.name field. Here is some example source code. char * GetWidgetName(w) Widget w; { # include return(w->core.name); } Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213