def resize(self):
        '''Determine position and dimension.

        Return boolean whether we are able to calculate all values or
        whether we need parent dimensions to continue.
        '''
        ok = True
        if self._width is None:
            w = self.width_spec.calculate()
            # if we calculated the value write it through the property so
            # that subclasses may react to the altered dimension
            if w is None: ok = False
            else: self.width = w
        if self._height is None:
            h = self.height_spec.calculate()
            if h is None: ok = False
            else: self.height = h
        return ok
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/element.py/Element.resize/original