【发布时间】:2021-09-10 11:49:43
【问题描述】:
我的代码
from tkinter import *
import tkinter as tk
from tkinter.filedialog import *
from tkPDFViewer import tkPDFViewer as pdf
def donothing():
x = 0
def open():
file=askopenfile()
v1 = pdf.ShowPdf()
v2 = v1.pdf_view(root,
pdf_location = file,
width = 200, height = 100)
v2.pack()
root = Tk()
root.state('zoomed')
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=donothing)
filemenu.add_command(label="Open", command=open)
filemenu.add_command(label="Save", command=donothing)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=root.quit)
menubar.add_cascade(label="File", menu=filemenu)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="Help Index", command=donothing)
helpmenu.add_command(label="About...", command=donothing)
menubar.add_cascade(label="Help", menu=helpmenu)
root.config(menu=menubar)
root.mainloop()
如果你打开第一个 pdf 文件,它的词非常好。但是 当您打开其他 pdf 文件时,它没有更新。那么我该如何解决呢?谢谢
【问题讨论】: