1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
L=[]
def Display_Image(fichier, L):
if W_image.winfo_exists() == 0:
W_image = Toplevel()
notebook = Pmw.NoteBook(W_Image)
notebook.pack(fill="both", expand=1, padx=10, pady=10)
Graph = notebook.add('Data'+str(len(L)))
notebook.tab('Data'+str(len(L))).focus_set()
Display = Canvas(Graph, width="600", height="500")
L.append(PhotoImage(file=fichier))
Display.create_image(300, 250, image=L[-1])
Display.image = L[-1]
Display.pack()
notebook.setnaturalsize()
Butt_Quit = Button(W_image, text="Quitter", command=W_image.destroy)
Butt_Quit.pack(side=RIGHT)
Butt_Pdf = Button(W_image, text="Ajouter au PDF", command=Reporting.Insert_Image)
Butt_Pdf.pack(side=RIGHT)
else:
notebook = Pmw.NoteBook(W_Image)
notebook.pack(fill="both", expand=1, padx=10, pady=10)
Graph = notebook.add('Data'+str(len(L)))
notebook.tab('Data'+str(len(L))).focus_set()
Display = Canvas(Graph, width="600", height="500")
L.append(PhotoImage(file=fichier))
Display.create_image(300, 250, image=L[-1])
Display.image = L[-1]
Display.pack()
notebook.setnaturalsize() |
Partager