Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!montnaro From: montnaro@spyder.crd.ge.com (Skip Montanaro) Newsgroups: comp.windows.x.motif Subject: Getting the name of a Gadget Message-ID: Date: 13 Jun 91 15:14:25 GMT Sender: news@crdgw1.crd.ge.com Reply-To: montanaro@crdgw1.ge.com (Skip Montanaro) Organization: GE Corporate Research & Development, Schenectady, NY Lines: 33 In my application I have a form that contains, among other things, a PushButtonGadget ("cancel") and a SeparatorGadget ("separator"). The topWidget resource of "cancel" is "separator". In a resource printing routine, I have a handle on the XtResourceList entry for cancel's topWidget. It is: (gdb) print *r $7 = { resource_name = 0x517ca8 "topWidget", resource_class = 0x50d534 "Widget", resource_type = 0x4d800c "Window", resource_size = 4, resource_offset = 56, default_type = 0x4d800c "Window", default_addr = 0x0 } Based upon the resource type field, I print out a more or less informative description of the widget (gadget in this case). In particular, for resource type "Window", I can safely call XtName() if it's a true widget, but not if it's a gadget. Is there some way I can detect that the resource value is actually a gadget, and call some other function or macro to get its name? Perhaps it's not kosher to use gadgets as resource values in forms? I saw nothing in the FAQ list regarding what can and can't be done with gadgets. Berlage's and Young's books are vague about gadget limitations, and the Motif Programmer's Reference and Programmer's Guide were equally uninformative. -- Skip (montanaro@crdgw1.ge.com)