Re: Tkinter.Text widget - how to get text cursor position?

Discussion in 'Python' started by Alex9968, Mar 19, 2008.

  1. Alex9968

    Alex9968 Guest

    Alex9968 wrote:
    > Is it possible to get position (in numbers) of the insertion cursor? As
    > I understood, Text widget uses mark named INSERT to store it, which is
    > available globally by just referencing INSERT, but how could I get
    > actual coordinate numbers of the mark?
    > I need this because I want not just to insert string at, but to examine
    > text before and after the insertion cursor. I can probably use .get() to
    > extract the halves of text before and after cursor, but it'd be better
    > just to know the position.
    >
    > Thanks

    It's .index()

    Problem was that it's missed in Tkinter reference: a GUI for Python
     
    Alex9968, Mar 19, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex9968
    Replies:
    0
    Views:
    582
    Alex9968
    Mar 19, 2008
  2. dmaziuk
    Replies:
    3
    Views:
    581
    Chris Gonnerman
    Jan 25, 2011
  3. Frederic Rentsch
    Replies:
    0
    Views:
    244
    Frederic Rentsch
    Jul 8, 2012
  4. Terry Reedy
    Replies:
    15
    Views:
    637
    Frederic Rentsch
    Jul 16, 2012
  5. Frederic Rentsch
    Replies:
    0
    Views:
    430
    Frederic Rentsch
    Jul 9, 2012
Loading...

Share This Page