peng3d/gui/widgets.py
def pos(self):
        """
        Property that will always be a 2-tuple representing the position of the widget.
        
        Note that this method may call the method given as ``pos`` in the initializer.
        
        The returned object will actually be an instance of a helper class to allow for setting only the x/y coordinate.
        
        This property also respects any :py:class:`Container` set as its parent, any offset will be added automatically.
        
        Note that setting this property will override any callable set permanently.
        """
        if isinstance(self._pos,list) or isinstance(self._pos,tuple):
            r = self._pos
        elif callable(self._pos):
            w,h = self.submenu.size[:]
            r = self._pos(w,h,*self.size)
        else:
            raise TypeError("Invalid position type")
        
        ox,oy = self.submenu.pos
        r = r[0]+ox,r[1]+oy
        
        #if isinstance(self.submenu,ScrollableContainer) and not self._is_scrollbar:# and self.name != "__scrollbar_%s"%self.submenu.name: # Widget inside scrollable container and not the scrollbar
        #    r = r[0],r[1]+self.submenu.offset_y
        return _WatchingList(r,self._wlredraw_pos)
def pos(self):
        """
        Property that will always be a 2-tuple representing the position of the widget.
        
        Note that this method may call the method given as ``pos`` in the initializer.
        
        The returned object will actually be an instance of a helper class to allow for setting only the x/y coordinate.
        
        This property also respects any :py:class:`Container` set as its parent, any offset will be added automatically.
        
        Note that setting this property will override any callable set permanently.
        """
        if isinstance(self._pos,list) or isinstance(self._pos,tuple):
            r = self._pos
        elif callable(self._pos):
            w,h = self.submenu.size[:]
            r = self._pos(w,h,*self.size)
        else:
            raise TypeError("Invalid position type")
        
        ox,oy = self.submenu.pos
        r = r[0]+ox,r[1]+oy
        
        #if isinstance(self.submenu,ScrollableContainer) and not self._is_scrollbar:# and self.name != "__scrollbar_%s"%self.submenu.name: # Widget inside scrollable container and not the scrollbar
        #    r = r[0],r[1]+self.submenu.offset_y
        return _WatchingList(r,self._wlredraw_pos)
Property that will always be a 2-tuple representing the position of the widget.
        
        Note that this method may call the method given as ``pos`` in the initializer.
        
        The returned object will actually be an instance of a helper class to allow for setting only the x/y coordinate.
        
        This property also respects any :py:class:`Container` set as its parent, any offset will be added automatically.
        
        Note that setting this property will override any callable set permanently.