self.size_hint = self.form_canvas.widgets_size_hint
for widget in self.form_canvas.walk(restrict=True):
- if type(widget) is Grabbable and widget.collide_point(x, y):
+ if isinstance(widget, Grabbable) and widget.collide_point(x, y):
idx = widget.get_index()
if widget.point_area == 'top':
widget.parent.add_widget(self, index=idx + 1)
widgets = self.walk(restrict=True)
next(widgets) # the first widget is the FormCanvas
for widget in widgets:
- if not type(widget) is Grabbable:
+ if not isinstance(widget, Grabbable):
# Look for the widget position inside the tree
parent = widget.parent
- if type(parent) is Grabbable:
+ if isinstance(parent, Grabbable):
parent = parent.parent
while not parent is stack[-1]:
stack.pop()