Marking hyperlinks in a Text widget

André Dahlqvist andre at beta.telenordia.se
Tue May 30 07:19:28 EDT 2000


I am trying to figure out how to mark text starting with http:// and ftp://
in a Text widget as hyperlinks. I know how to mark all the text I am
inserting as hyperlinks:

text.tag_config("hyperlink", foreground="blue", underline=1)
text.insert(END, "http://www.python.org", "hyperlink")

But what if I am inserting a large chunk of text that can contain links
anywhere in it? How do I mark the sentences starting with http:// and 
ftp:// in that text as hyperlinks?

// André




More information about the Python-list mailing list