New style for link
This commit is contained in:
parent
9c83fa873a
commit
029889966f
|
@ -1,12 +1,10 @@
|
|||
import tkinter as tk
|
||||
|
||||
def myTest(test):
|
||||
print("coucou")
|
||||
print(test)
|
||||
import tkinter.font as tkFont
|
||||
|
||||
class Renderer():
|
||||
def __init__(self, parent):
|
||||
self.parent = parent
|
||||
self.underlineFont = tkFont.Font(underline=1)
|
||||
self.content = tk.Text(self.parent)
|
||||
self.currX = 0
|
||||
self.currY = 1
|
||||
|
@ -23,6 +21,7 @@ class Renderer():
|
|||
|
||||
def addLink(self, text):
|
||||
index1 = str(self.currY)+'.'+str(self.currX)
|
||||
self.content.tag_config("link-"+index1, foreground="#00f", font=self.underlineFont)
|
||||
self.content.tag_bind("link-"+index1, "<Button-1>", lambda event, url=text:
|
||||
print(url))
|
||||
self.content.insert(index1, text+"\n")
|
||||
|
|
Reference in New Issue