Skip to content

Commit

Permalink
增加了跳转页码按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
cforth committed May 5, 2019
1 parent 6f56ec3 commit 74b8b9b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ImgLook.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@ def __init__(self, master=None):
self.imgInfoLabel['textvariable'] = self.imgInfo
self.imgInfoLabel.grid(sticky=('w',), row=3, column=0, columnspan=2)
self.jumpPageNumberLabel = tk.Label(self, text="跳转页码:")
self.jumpPageNumberLabel.grid(sticky=('e',), row=3, column=4)
self.jumpPageNumberLabel.grid(sticky=('e',), row=3, column=3)
self.jumpPageNumberEntry = tk.Entry(self, width=10)
self.jumpPageNumber = tk.StringVar()
self.jumpPageNumberEntry['textvariable'] = self.jumpPageNumber
self.jumpPageNumberEntry.grid(sticky=('w',), row=3, column=5)
self.jumpPageNumberEntry.grid(sticky=('w', 'e'), row=3, column=4)
self.jumpPageNumberButton = ttk.Button(self, text="GO", width=10)
self.jumpPageNumberButton.grid(sticky=('w', 'e'), row=3, column=5)
self.jumpPageNumberButton['command'] = self.jump_page_callback

# 支持的图片格式后缀
self.img_ext = [".bmp", ".gif", ".jpg", ".png", ".tiff", ".ico", ".jpeg"]
Expand Down Expand Up @@ -195,9 +198,9 @@ def set_img_info(self):
img_name_next = os.path.basename(self.img_list[img_index_next])
order_option = self.orderOption.get()
if order_option == "左开":
self.imgInfo.set(index_str + "," + index_str_next + " : " + img_name + " | " + img_name_next)
self.imgInfo.set(index_str + ", " + index_str_next + " : " + img_name + " | " + img_name_next)
else:
self.imgInfo.set(index_str_next + "," + index_str + " : " + img_name_next + " | " + img_name)
self.imgInfo.set(index_str_next + ", " + index_str + " : " + img_name_next + " | " + img_name)
else:
self.imgInfo.set(index_str + " : " + img_name)

Expand Down

0 comments on commit 74b8b9b

Please sign in to comment.