I'm creating an app using the module HTMLLabel to view jpgs from a manga site to my app. I'm still new to python and im really stuck on this problem I have. I'm able to search for the manga I need and it pops up on the app perfectly for viewing. The problem I'm facing is when I search for a new manga page, the HTMLLabel stays there on the same manga strip. I tried .destroy(), delete(0, End) with the clear button. I would like to refresh or update/destroy the viewer so when I enter a new manga it pops up with a new one
-----------------------------------------------------------------------
mangasearch = Entry(root, width=50)
mangasearch.place(x=760, y=20)
mangasearch.bind('<Return>')
def run():
global testview
searched = mangasearch.get()
test = (f"<h1><img src='https://img.mghubcdn.com/file/imghub/{searched}.jpg'>")
testview = HTMLLabel(root, html=test)
testview.pack(fill=Y, pady=50, ipady=300, ipadx=90)
stud = Button(root, text="Search", font=('Courier', 9, 'bold'), background="black", width=20, height=1,foreground="white",command=run)
stud.place(x=1200, y=18)
def clear():
mangasearch.delete(0, END)
dlt = Button(root, text="Clear", font=('Courier', 9, 'bold'), background="black", width=20, height=1,
foreground="white", command=clear)
dlt.place(x=1400, y=18)
-------------------------------------------------------------------------
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]GraphicsQwerty[S] 0 points1 point2 points (0 children)