Hi all, is it possible to listen for changes in View.frame, View.x etc... so that changing them could results in calling other functions?
I tried subclassing ui.View and using a property(get, set, del) called x but changes on it doesn’t reflect in View.frame.
class PView(ui.View):
def __init__(self):
self._x = None
@property
def x(self):
return self._x
@x.setter
def x(self, value):
self._x = value
self.layout()
def layout(self):
print(self.frame)
Let say I have c = PView()
Now c.frame leads to Rect(0, 0, 100, 100)
Calling c.x = 7 will print Rect(0, 0, 100, 100) instead of Rect(7, 0, 100, 100)
Also, calling c.frame = (9, 0, 100, 100) doesn’t print Rect(9, 0, 100, 100) as requested and c.x doesn’t lead to 9.