We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9a083d commit eddb774Copy full SHA for eddb774
1 file changed
Source/image_viewer.py
@@ -6,15 +6,20 @@
6
# Define the image file path
7
image_path = "data_image.png"
8
9
+window = None # Declare the window variable
10
+
11
def open_image():
12
file_path = filedialog.askopenfilename(filetypes=[("Image files", "*.png *.jpg *.jpeg *.gif *.bmp *.ppm *.pgm *.tif *.tiff")])
13
if file_path:
14
display_image(file_path)
15
16
def exit_viewer():
- window.destroy()
17
+ if window:
18
+ window.destroy()
19
20
def display_image(image_path, resize_width=None, resize_height=None):
21
+ global window # Use the global window variable
22
23
# Create a new window
24
window = tk.Tk()
25
window.title("Pixel Data Image Viewer")
0 commit comments