Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 166ed32

Browse files
Up/Down Events
Up/Down arrow key events combined together.
1 parent fda0a94 commit 166ed32

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎Sample GUI Implementation/image_viewer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''IMAGE VIEWER
1+
'''Py IMAGE VIEWER
22
33
PySimpleGUI reads images in PNG, GIF, PPM/PGM format.
44
JPEGs cannot be shown because tkinter does not naively support these formats.
@@ -125,10 +125,8 @@ def up_down_arrow_key_selection(arrow_key_event):
125125
elif EVENT == "-FILE LIST-": # Display the image selected.
126126
process_and_view_image()
127127

128-
elif EVENT == 'Up:38':
129-
up_down_arrow_key_selection(EVENT)
130-
process_and_view_image()
131-
elif EVENT == 'Down:40':
128+
# Listbox Navigation using Up/Down Arrow keys.
129+
elif EVENT in ('Up:38', 'Down:40'):
132130
up_down_arrow_key_selection(EVENT)
133131
process_and_view_image()
134132

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /