Mercurial > libervia-desktop-kivy
comparison cagou/core/cagou_main.py @ 331:d36040493434
core: fixed handling of classes with multiple inheritances in getAncestorWidget
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Dec 2019 12:29:37 +0100 |
parents | 5bd583d00594 |
children | 89799148f894 |
comparison
equal
deleted
inserted
replaced
330:bc977e3ff2aa | 331:d36040493434 |
---|---|
1008 @param wid(Widget): current widget | 1008 @param wid(Widget): current widget |
1009 @param cls(type): class of the ancestor to retrieve | 1009 @param cls(type): class of the ancestor to retrieve |
1010 @return (Widget, None): found instance or None | 1010 @return (Widget, None): found instance or None |
1011 """ | 1011 """ |
1012 parent = wid.parent | 1012 parent = wid.parent |
1013 while parent and parent.__class__ != cls: | 1013 while parent and not isinstance(parent, cls): |
1014 parent = parent.parent | 1014 parent = parent.parent |
1015 return parent | 1015 return parent |