質問

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

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top