Member Avatar for masterofpuppets

hi all,
I am designing a text editor program in Python using Tkinter and I was wondering if there's any way to get the current line number when the mouse is clicked somewhere on the text field, i.e the mouse position should determine the current line, like in the python editor window... for the text field I am using a ScrolledText widget.
Any help or hint is appreciated :) thx in advance :)

Recommended Answers

All 2 Replies

Member Avatar for masterofpuppets

thanks a lot :) that's exactly what I was looking for, I'll just modify the bind function to .bind( "<Button-1>",.... ) instead of "<KeyRelease>" to get the col and line for the mouse position. :)

P.S i didn't see the example sry for that :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.