From 8adb35e0e25a78760eea1e2d14e7b831e80d1811 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 21 Sep 2019 14:59:29 -0400 Subject: [PATCH] Renamed function --- DemoPrograms/Demo_Buttons_Nice_Graphics.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DemoPrograms/Demo_Buttons_Nice_Graphics.py b/DemoPrograms/Demo_Buttons_Nice_Graphics.py index 78ae1b5b..01397400 100644 --- a/DemoPrograms/Demo_Buttons_Nice_Graphics.py +++ b/DemoPrograms/Demo_Buttons_Nice_Graphics.py @@ -9,7 +9,7 @@ from PIL import Image import base64 -def image_file_to_bytes(image64, size): +def resize_base64_image(image64, size): image_file = io.BytesIO(base64.b64decode(image64)) img = Image.open(image_file) img.thumbnail(size, Image.ANTIALIAS) @@ -29,11 +29,11 @@ def ShowMeTheButtons(): toolbar_buttons = [ [sg.Text('Who says Windows have to be ugly when using tkinter?', size=(45,3))], [sg.Text('All of these buttons are part of the code itself', size=(45,2))], - [sg.Button('Next', image_data=image_file_to_bytes(button64, (100,50)),button_color=wcolor, font='Any 15', pad=(0,0), key='-NEXT-'), - # [sg.Button('Exit', image_data=image_file_to_bytes(black64, (100,50)),button_color=bcolor, font='Any 15', pad=(0,0), key='_close_'),], - sg.Button('Submit', image_data=image_file_to_bytes(red_pill64, (100,50)),button_color=wcolor, font='Any 15', pad=(0,0), key='-SUBMIT-'), - sg.Button('OK', image_data=image_file_to_bytes(green_pill64, (100,50)),button_color=bcolor, font='Any 15', pad=(0,0), key='-OK-'), - sg.Button('Exit', image_data=image_file_to_bytes(orange64, (100,50)),button_color=bcolor, font='Any 15', pad=(0,0), key='-EXIT-'),], + [sg.Button('Next', image_data=resize_base64_image(button64, (100, 50)), button_color=wcolor, font='Any 15', pad=(0, 0), key='-NEXT-'), + # [sg.Button('Exit', image_data=image_file_to_bytes(black64, (100,50)),button_color=bcolor, font='Any 15', pad=(0,0), key='_close_'),], + sg.Button('Submit', image_data=resize_base64_image(red_pill64, (100, 50)), button_color=wcolor, font='Any 15', pad=(0, 0), key='-SUBMIT-'), + sg.Button('OK', image_data=resize_base64_image(green_pill64, (100, 50)), button_color=bcolor, font='Any 15', pad=(0, 0), key='-OK-'), + sg.Button('Exit', image_data=resize_base64_image(orange64, (100, 50)), button_color=bcolor, font='Any 15', pad=(0, 0), key='-EXIT-'), ], ] # layout = toolbar_buttons