From 92d77a5ba820ee033f6e5400616721d5bc810ff5 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Tue, 3 Jan 2023 14:16:52 -0500 Subject: [PATCH] Make the Image element expand so that the buttons will not jump around as much. --- DemoPrograms/Demo_PNG_Viewer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_PNG_Viewer.py b/DemoPrograms/Demo_PNG_Viewer.py index 5edb8ba1..6fc35b3f 100644 --- a/DemoPrograms/Demo_PNG_Viewer.py +++ b/DemoPrograms/Demo_PNG_Viewer.py @@ -32,14 +32,14 @@ def main(): # define layout, show and read the window col = [[sg.Text(png_files[0], size=(80, 3), key='-FILENAME-')], - [sg.Image(filename=png_files[0], key='-IMAGE-')], + [sg.Image(filename=png_files[0], key='-IMAGE-', expand_x=True, expand_y=True)], [sg.Button('Next', size=(8, 2)), sg.Button('Prev', size=(8, 2)), sg.Text('File 1 of {}'.format(len(png_files)), size=(15, 1), key='-FILENUM-')]] col_files = [[sg.Listbox(values=filenames_only, size=(60, 30), key='-LISTBOX-', enable_events=True)], [sg.Text('Select a file. Use scrollwheel or arrow keys on keyboard to scroll through files one by one.')]] - layout = [[sg.Menu(menu)], [sg.Col(col_files), sg.Col(col)]] + layout = [[sg.Menu(menu)], [sg.Col(col_files), sg.Col(col, expand_x=True, expand_y=True)]] window = sg.Window('Image Browser', layout, return_keyboard_events=True, use_default_focus=False)