Skip to content

Commit

Permalink
fix: invalidate the previous contents before populating with new weather
Browse files Browse the repository at this point in the history
  • Loading branch information
DevipriyaSarkar committed Jan 14, 2017
1 parent fba4d8b commit 433be01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def __init__(self, master, city):
font=("Helvetica", 10, "bold"))
label_empty_str.place(relx=0.5, rely=0.5, anchor="center")
label_empty_str.pack(fill=BOTH, expand=1, padx=4, pady=4)

button_city.config(state=NORMAL)

# get the weather information of the passed city id
Expand Down Expand Up @@ -254,8 +255,8 @@ def button_state_check(self):
def show():
city = entry_city.get()
print city
content_frame = Frame(root)
content_frame.grid(row=1, columnspan=2)
for child in content_frame.winfo_children():
child.destroy()
Weather(content_frame, city)

root = Tk()
Expand All @@ -280,6 +281,9 @@ def show():
entry_city.grid(row=0, column=1, padx=4, pady=4)
entry_city.focus_set()

content_frame = Frame(root)
content_frame.grid(row=1, columnspan=2)

button_city = Button(top_frame, text="Show Weather", command=show, font=font, relief=GROOVE)
button_city.grid(row=1, columnspan=2, padx=4, pady=4)

Expand Down

0 comments on commit 433be01

Please sign in to comment.