def coerce_pos(thing): """ Coerce a thing to a Pos. """ if isinstance(thing, tuple): return Pos(*thing) if isinstance(thing, (int, float)): return Pos(thing, thing) msg = "Cannot coerce object of type '%s' to a Pos" raise ValueError(msg % type(thing).__name__)
def pos(self): """ Get the current mouse position of the operation. Returns ------- result : Pos The mouse position of the operation in widget coordinates. """ qpos = self._q_event.pos() return Pos(qpos.x(), qpos.y())
def position(self): """ Get the position of the window frame. Returns ------- result : Pos The current position of the window frame. """ if self.proxy_is_active: return self.proxy.position() return Pos(-1, -1)
def position(self): """ Get the position of the of the window. """ point = self.widget.pos() return Pos(point.x(), point.y())
def position(self): """ Get the position of the of the window. """ return Pos(*self.widget.position)