Liam Willis
Liam Willis

Reputation: 681

Line number and column number in Text Widget

Is there some method which tells you the line number and column number of a Text widget in Perl/Tk?

Upvotes: 0

Views: 533

Answers (1)

Dave Cross
Dave Cross

Reputation: 69244

According to the documentation, the widget has a method index() which returns the "line.char" of various positions in the widget. Pass it the name of the special mark "insert" to get the current position of the insertion cursor. Pass it the name of the special mark "current" to get the current position on the mouse.

Your question doesn't make it clear which of the two you want.

Upvotes: 3

Related Questions