MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / make_thumbnails

Function make_thumbnails

DemoPrograms/Demo_Image_Viewer_Thumbnails.py:81–94  ·  view source on GitHub ↗
(flist)

Source from the content-addressed store, hash-verified

79
80
81def make_thumbnails(flist):
82 layout = [[]]
83 for row in range(THUMBNAILS_PER_PAGE[1]):
84 row_layout = []
85 for col in range(THUMBNAILS_PER_PAGE[0]):
86 try:
87 f = flist[row*THUMBNAILS_PER_PAGE[1] + col]
88 # row_layout.append(sg.B(image_data=convert_to_bytes(f, THUMBNAIL_SIZE), k=(row,col), pad=THUMBNAIL_PAD))
89 row_layout.append(sg.B('',k=(row,col), size=(0,0), pad=THUMBNAIL_PAD,))
90 except:
91 pass
92 layout += [row_layout]
93 layout += [[sg.B(sg.SYMBOL_LEFT + ' Prev', size=(10,3), k='-PREV-'), sg.B('Next '+sg.SYMBOL_RIGHT, size=(10,3), k='-NEXT-'), sg.B('Exit', size=(10,3)), sg.Slider((0,100), orientation='h', size=(50,15), enable_events=True, key='-SLIDER-')]]
94 return sg.Window('Thumbnails', layout, element_padding=(0, 0), margins=(0, 0), finalize=True, grab_anywhere=False, location=(0,0), return_keyboard_events=True)
95
96EXTS = ('png', 'jpg', 'gif')
97

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected