

def show_tip(self, tip):
    ' Attempts to show the specified tip at the current cursor location.\n        '
    text_edit = self._text_edit
    document = text_edit.document()
    cursor = text_edit.textCursor()
    search_pos = (cursor.position() - 1)
    (self._start_position, _) = self._find_parenthesis(search_pos, forward=False)
    if (self._start_position == (- 1)):
        return False
    self.setText(tip)
    self.resize(self.sizeHint())
    padding = 3
    cursor_rect = text_edit.cursorRect(cursor)
    screen_rect = QtGui.QApplication.desktop().screenGeometry(text_edit)
    point = text_edit.mapToGlobal(cursor_rect.bottomRight())
    point.setY((point.y() + padding))
    tip_height = self.size().height()
    if ((point.y() + tip_height) > screen_rect.height()):
        point = text_edit.mapToGlobal(cursor_rect.topRight())
        point.setY(((point.y() - tip_height) - padding))
    self.move(point)
    self.show()
    return True

dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/console/call_tip_widget.py CallTipWidget.show_tip/original