peng3d/gui/widgets.py
def size(self):
        """
        Similar to :py:attr:`pos` but for the size instead.
        """
        if isinstance(self._size,list) or isinstance(self._size,tuple):
            s = self._size
        elif callable(self._size):
            w,h = self.submenu.size[:]
            s = self._size(w,h)
        else:
            raise TypeError("Invalid size type")
        
        s = s[:]
        
        if s[0]==-1:
            s[0]=self.getMinSize()[0]
        if s[1]==-1:
            s[1]=self.getMinSize()[1]
    
        # Prevents crashes with negative size
        s = [max(s[0],0),max(s[1],0)]
        return _WatchingList(s,self._wlredraw_size)
def size(self):
        """
        Similar to :py:attr:`pos` but for the size instead.
        """
        if isinstance(self._size,list) or isinstance(self._size,tuple):
            s = self._size
        elif callable(self._size):
            w,h = self.submenu.size[:]
            s = self._size(w,h)
        else:
            raise TypeError("Invalid size type")
        
        s = s[:]
        
        if s[0]==-1:
            s[0]=self.getMinSize()[0]
        if s[1]==-1:
            s[1]=self.getMinSize()[1]
    
        # Prevents crashes with negative size
        s = [max(s[0],0),max(s[1],0)]
        return _WatchingList(s,self._wlredraw_size)
def size ( self ) : if isinstance ( self . _size , list ) or isinstance ( self . _size , tuple ) : s = self . _size elif callable ( self . _size ) : w , h = self . submenu . size [ : ] s = self . _size ( w , h ) else : raise TypeError ( "Invalid size type" ) s = s [ : ] if s [ 0 ] == - 1 : s [ 0 ] = self . getMinSize ( ) [ 0 ] if s [ 1 ] == - 1 : s [ 1 ] = self . getMinSize ( ) [ 1 ] # Prevents crashes with negative size s = [ max ( s [ 0 ] , 0 ) , max ( s [ 1 ] , 0 ) ] return _WatchingList ( s , self . _wlredraw_size )
Similar to :py:attr:`pos` but for the size instead.
Similar to : py : attr : pos but for the size instead .