From abaa6ea9a1588b64c731144df5d3c4d045a98217 Mon Sep 17 00:00:00 2001 From: "Richard Horton (hortonr6)" Date: Mon, 20 Nov 2017 20:52:32 +0000 Subject: [PATCH] Changed the way tkinter was being imported to match other files Not necessary to do as the code is obselete but helps keep things easy to read --- HLTest.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/HLTest.py b/HLTest.py index 3530b2c..1191047 100644 --- a/HLTest.py +++ b/HLTest.py @@ -1,29 +1,33 @@ +#Obselete Code - Used to test external code stored in tkHyperlinkManager.py + import tkHyperlinkManager import webbrowser -from tkinter import * +import tkinter as tk -root = Tk() -root.title("hyperlink-1") +root = tk.Tk() +root.title("Hyperlink Manager Test") -text = Text(root) +text = tk.Text(root) text.pack() hyperlink = tkHyperlinkManager.HyperlinkManager(text) -def click1(): +def click1(): #Richard print ("click 1") url = "https://www.google.co.uk" webbrowser.open(url, new=2) -text.insert(INSERT, "this is a ") -text.insert(INSERT, "link", hyperlink.add(click1)) -text.insert(INSERT, "\n\n") +text.insert(tk.INSERT, "this is a ") +text.insert(tk.INSERT, "link", hyperlink.add(click1)) +text.insert(tk.INSERT, "\n\n") -def click2(): +def click2(): #Richard print ("click 2") + url = "https://www.google.co.uk" + webbrowser.open(url, new=2) -text.insert(INSERT, "this is another ") -text.insert(INSERT, "link", hyperlink.add(click2)) -text.insert(INSERT, "\n\n") +text.insert(tk.INSERT, "this is another ") +text.insert(tk.INSERT, "link", hyperlink.add(click2)) +text.insert(tk.INSERT, "\n\n") -mainloop() +tk.mainloop()