The widget stores the link to the parent in self.parent . That way you can just self.parent.size or self.parent.pos or something else.
Depending on what you are doing, it may be necessary or useful to make sure that you first check to see if self.parent is None so that your code does not depend on widgets without a parent.
inclement
source share