Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def treetips::TreeTips::__compute_tooltip_position (   self,
  cellInfo,
  popupWidth,
  popupHeight 
) [private]

Figures out where the tooltip should be placed on the page::

  [p] = pointer
  x =      [p]
       +---------+
  (half on each side)
  
  y =      [p]
      +------------+
      |____________|
  If it fits else:
      +------------+
      |____________|
   [p]

Definition at line 196 of file treetips.py.

00196                                                                            :
        '''Figures out where the tooltip should be placed on the page::

          [p] = pointer
          x =      [p]
               +---------+
          (half on each side)
  
          y =      [p]
              +------------+
              |____________|
          If it fits else:
              +------------+
              |____________|
                   [p]
        '''

        xOrigin, yOrigin = self.view.get_bin_window().get_origin()
        x = xOrigin + cellInfo.x + cellInfo.width/2 - popupWidth/2
        if x < 0:
            x = 0
        elif x + popupWidth > self.screenWidth:
            x = self.screenWidth - popupWidth

        y = yOrigin + cellInfo.y + cellInfo.height + 3
        if y + popupHeight > self.screenHeight:
            y = yOrigin + cellInfo.y - 3 - popupHeight
            if y < 0:
                y = 0

        return x, y
gobject.type_register(TreeTips)
gobject.type_register(TreeTips)


Generated by  Doxygen 1.6.0   Back to index