(widget, wtype)
return(False)
Walk up the family tree of widget to see if any ancestors are of type
Walk up the family tree of widget to see if any ancestors are of type
Walk up the family tree of widget to see if any ancestors are of type
def has_ancestor(widget, wtype):
    """Walk up the family tree of widget to see if any ancestors are of type"""
    while widget:
        widget = widget.get_parent()
        if isinstance(widget, wtype):
            return(True)
    return(False)
def has_ancestor ( widget , wtype ) : while widget : widget = widget . get_parent ( ) if isinstance ( widget , wtype ) : return ( True ) return ( False )