0

Ok, so I know I can do:

curPos = self.LogWindow.GetInsertionPoint
lineNum = self.LogWindow.GetRange( 0, self.LogWindow.GetInsertionPoint() ).split("\n")
lineText = self.LogWindow.GetLineText(lineNum)

But how can I set the InsertionPoint to the end of the current lint?

Current line of course meaning: the line where the InserionPoint is currently located.

Any help appreciated :).

Montmons
  • 1,416
  • 13
  • 44

1 Answers1

1

Try:

    curPos = self.log.GetInsertionPoint()
    curCol,curRow = self.log.PositionToXY(curPos)
    lineNum = curRow
    lineText = self.log.GetLineText(lineNum)
    newPos=self.log.XYToPosition(len(lineText), curRow)
    self.log.SetInsertionPoint(newPos)
  • Thanks! One slight error: for me `self.log.PositionToXY(curPos)` returns three values: `(True, curCol, curRow)`. So I changed the second line to: `curVal,curCol,curRow = self.log.PositionToXY(curPos)` – Montmons Dec 25 '17 at 12:21