Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: widgets and their names Message-ID: <8907251934.AA03476@expo.lcs.mit.edu> Date: 25 Jul 89 19:34:25 GMT References: <8907082311.AA09591@bullwinkle.unm.edu> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 30 > We know that there are proposals event playback, but we want to be > able to use the journal to perform the same process on different > data sets. > The two questions we have are: > 1) Given a widget, how do you get the full xrm resource name. Make recursive calls to XtParent until it returns NULL. This will give you every widget parent of this widget. Getting the names of each of these widgets is tough, in R3 the only way to do it is to look at widget->core.name, in R4 there will be a public routine that will return the name of a widget. > 2) Given the full xrm resource name, how do you get the widget. > NOTE: We tried using XtNameToWidget(root,name), but during playback > we do not have access to all root (toplevel) widgets. Your idea is the right one, but you will need at least one widget in the tree, since widget names need not be unique. Think about multiple invocations of the program on the same display, this is certainly allowed, and the widget names are all the same. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213