| | |
Line number in Tkinter Text field
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
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
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
0
#3 Oct 31st, 2009
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
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
![]() |
Other Threads in the Python Forum
- Previous Thread: ToolTip box
- Next Thread: DNA Questions
| Thread Tools | Search this Thread |
account argv arithmetic array basic beginner c++ changecolor cmd college command conversion file fstream game generator gnu guess guessing line maximum ms number numbertoword output php prime program programing python query random read recursion regex result scrolledtext sequential sets sql string textarea trim vbnet visual word







