[comp.windows.x] unexpected XtIsWidget behavior

dbeck@flopn2.csc.ti.COM (Dave Beck) (03/08/91)

ALERT! XtIsWidget does not seem to recognize Motif gadgets as widgets!  
Despite the fact that gadgets use the same type structure (their creation 
routines return Widget) this check fails. It must look for the window 
gadgets don't create or something.  Why is this?

We were using XtIsWidget to check creation of every widget we create for
general debugging purposes.  Does Motif know about this?  I can't find an
XmIsGadget; is there an undocumented function that provides this somewhere?  

X11R4, Motif 1.1, Sun Sparc 1+

Dave Beck
dbeck@flopn2

Texas Instruments Software Systems and Applications Lab
Dallas

converse@expo.lcs.mit.EDU (03/09/91)

> XtIsWidget does not seem to recognize Motif gadgets as widgets!  

That's because they're not widgets.


> Despite the fact that gadgets use the same type structure (their creation 
> routines return Widget) this check fails. It must look for the window 
> gadgets don't create or something.  Why is this?

It checks to see whether or not the widget is equal to or is a subclass 
of WidgetClass.  Objects, or as they seem to be known in Motif-land, 
gadgets, are not subclasses of WidgetClass.


> We were using XtIsWidget to check creation of every widget we create for
> general debugging purposes. 

You need to read the interface definition for XtIsWidget.