Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、「undotext」ウィジェットを使用してスクリプトを作成しました。マウス カーソルが立っている場所の行インデックスを取得する方法を探しています。
同様に、ユーザーが行の一部を選択した場合。
(x、yだけでなく)テキスト座標でマウスカーソルの現在の位置を取得するには、次のいずれかを行う必要があります。
$txt->index("current");
またはこれ(テキストウィジェットを基準にし$xた$yマウスカーソルの位置を指定します):
$x
$y
$txt->index("@$x,$y");
前者の方が間違いなく便利ですが、ドラッグの最中にある場合は後者が必要です(currentマウスボタンが押されている間はマークは更新されません)。
current