I'm trying to display text from a database on screen once a button is pressed. Here is my code:
root = Tk()
root.geometry("800x500")
vfr_import = PhotoImage(file="Images/vfr.png")
r_vfr = vfr_import.subsample(3, 3)
class Airfields(Button):
def __init__(self, master, image, command, location):
Button.__init__(self, master, image=image, command=command)
self.style = {"bg":"#7D7D7D","bd":0,"highlightbackground":"#7D7D7D","highlightthickness":0}
self.place(x=location[0], y=location[1])
self.config(self.style)
class TextBox(Text):
def __init__(self, master, text, location):
Text.__init__(self, master, text=text)
self.style = {"bg":"Black","font":"(Arial, 12)"}
self.place(x=location[0], y=loaction[1])
self.config(self.style)
def display_info(location):
name = TextBox(root, str(c.execute("""SELECT Name FROM Airfields WHERE ICAO = (?)""", (location,))), [500,300])
Andrewsfield = Airfields(root, r_vfr, display_info('EGSL'), [255, 375])
However I get the error 'TclError: unknown option "-text"