index in Tkinter text objects

Matthew Dixon Cowles matt at mondoinfo.com
Sun Sep 3 13:57:11 EDT 2000


On Sun, 3 Sep 2000 11:58:55 -0700, Keagan Schopfer
<the_mantis at antionline.com> wrote:

>thanks for the info. it worked fine, but is there a way to get the
>first and the last index of a string of highlighted (for cut and copy
>purposes) text?
>
>thanks once again.
>from Keagan Schopfer

Yes, there is. Just as you can refer to the current insertion point by
giving mark methods the symbolic name INSERT, you can refer to the
current selection in the text widget by giving tag methods the
symbolic name SEL.

You may want to have a look at Fredrik Lundh's excellent Introduction
to Tkinter. Selection ranges are discussed at (wrapped for line
length).

http://www.pythonware.com/library/tkinter/
  introduction/x7991-methods.htm

Regards,
Matt



More information about the Python-list mailing list