Skip to content

Commit

Permalink
修复按键绑定
Browse files Browse the repository at this point in the history
  • Loading branch information
cforth committed Jun 17, 2018
1 parent 74f67c0 commit e3115e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CryptoApp.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class RootWindow(ttk.Frame):
def img_look(self):
self.clear_window()
self.ChildWindow = ImgLook.Window("ImgLookUI.json", self)
self.master.bind("<Key>", self.ChildWindow.key_event)
self.master.title("图片查看器")
self.master.minsize(600, 600)

Expand Down
13 changes: 7 additions & 6 deletions ImgLook.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ def __init__(self, ui_json, master=None):
# 保存当前的图片路径
self.current_img_path = ""
# 初始化下拉列表,设置默认值
self.init_default_crypto_option()
# 设置单页显示
set_combobox_item(self.__dict__["pageOptionCombobox"], "单页", True)
# 设置双页阅读顺序
set_combobox_item(self.__dict__["orderOptionCombobox"], "左开", True)
self.init_default_combobox_item()
# 设置图片最大的宽度(gif图片不能缩放)
self.img_max_width = 1280
# 设置默认的图片宽度,并设置图片大小滑动条的位置
Expand All @@ -50,8 +46,13 @@ def __init__(self, ui_json, master=None):
self.rowconfigure(2, weight=1)

# 初始化下拉列表,设置默认值
def init_default_crypto_option(self):
def init_default_combobox_item(self):
# 设置默认的选项
set_combobox_item(self.__dict__["cryptoOptionCombobox"], "不需解密", True)
# 设置单页显示
set_combobox_item(self.__dict__["pageOptionCombobox"], "单页", True)
# 设置双页阅读顺序
set_combobox_item(self.__dict__["orderOptionCombobox"], "左开", True)

# 根据图片路径,将当前文件夹内所有图片保存在图片列表,用于前后翻页显示
def set_img_list(self):
Expand Down

0 comments on commit e3115e5

Please sign in to comment.