Path: utzoo!attcan!uunet!wuarchive!usc!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!asuvax!hrc!uucs1!gaf From: gaf@uucs1.UUCP (gaf) Newsgroups: comp.windows.x Subject: Re: Getting ID for widget loaded from .uid? (Motif) Message-ID: <227@uucs1.UUCP> Date: 11 Jan 90 21:04:00 GMT References: <223@uucs1.UUCP> <1990Jan10.172318.20172@athena.mit.edu> Reply-To: gaf@uucs1.UUCP () Organization: UUCS inc., Phoenix Az Lines: 40 In article <1990Jan10.172318.20172@athena.mit.edu> bjaspan@athena.mit.edu (Barr3y Jaspan) writes: >1) XtNameToWidget takes a widget and a list of names of children and >returns the widget ID of the last child in the list. For example, >suppose you have the widget tree > > foo > bar baz > quux > >Then XtNameToWidget(foo, "bar.quux") would return the ID of "quux." Ralph Swick also suggested this, and I've made it work in my program, but have a nit to pick with it. Doing this ties the code to a specific widget hierarchy, so that if the button moves to a different menu the code must change, too. This would be a shame, as preventing this is the main benefit of UIL. >Presumably the ID of "foo" comes from MrmFetchHierarchy(). I seem to >recall there being a problem with using this with popup windows or menus I discovered the following, which may or may not be unique to Motif. Starting with the menu bar widget as reference, the toggle button on the pulldown is named "popup_File_pulldown.File_pulldown.Logging". I would never have guessed the "popup_File_pulldown" part of it, since the hierarchy I created was "File_pulldown.Logging". Good thing we bought the source! >2) callbacks. Boy, talk about missing something obvious! The callback is provided with the widget ID as its first argument. I've even used it before. Good grief. This is sort of like asking if anyone has seen your glasses, only to be told they're on top of your head. Must be time for a vacation. Thanks to all. -- Guy Finney It's that feeling of deja-vu UUCS inc. Phoenix, Az all over again. ncar!noao!asuvax!hrc!uucs1!gaf sun!sunburn!gtx!uucs1!gaf