diff --git a/WeatherApp.py b/WeatherApp.py index 467d3c9..6c9dedf 100644 --- a/WeatherApp.py +++ b/WeatherApp.py @@ -38,7 +38,7 @@ def get_weather(city): canvas = tk.Canvas(root, height=HEIGHT, width=WIDTH) canvas.pack() -background_image = tk.PhotoImage(file='landscape.png') +background_image = tk.PhotoImage(file='landscape.png',master=root) background_label = tk.Label(root, image=background_image) background_label.place(relwidth=1, relheight=1) @@ -57,4 +57,4 @@ def get_weather(city): label = tk.Label(lower_frame) label.place(relwidth=1, relheight=1) -root.mainloop() \ No newline at end of file +root.mainloop() diff --git a/WeatherApp_withicons.py b/WeatherApp_withicons.py index e21821a..c14766a 100644 --- a/WeatherApp_withicons.py +++ b/WeatherApp_withicons.py @@ -40,7 +40,7 @@ def open_image(icon): weather_icon.image = img C = tk.Canvas(app, height=HEIGHT, width=WIDTH) -background_image= tk.PhotoImage(file='./landscape.png') +background_image= tk.PhotoImage(file='./landscape.png',master=app) background_label = tk.Label(app, image=background_image) background_label.place(x=0, y=0, relwidth=1, relheight=1) @@ -73,4 +73,4 @@ def open_image(icon): -app.mainloop() \ No newline at end of file +app.mainloop()