import Tkinter as Tkt
import tkMessageBox
import Image, ImageTk, ttk

root = Tkt.Tk()

def ask_quit():
    if tkMessageBox.askokcancel('Quit', 'Do you really want to close all?'):
        root.destroy()
        cond_exit.set(1)

root.protocol("WM_DELETE_WINDOW", ask_quit)

cond_exit = Tkt.IntVar()
cond_exit.set(0)

def pic():

    root_pic = Tkt.Toplevel()

    F1 = ttk.Frame(root_pic)
    F1.pack()

    image1_1 = Image.open('20188.jpg')
    image1_2 = image1_1.resize((130,200))
    photo1 = ImageTk.PhotoImage(image1_2)

    L1 = ttk.Label(F1)
    L1.config(image = photo1)
    L1.image = image1_2
    L1.grid(row = 0, column = 0)

    L2 = ttk.Label(F1)
    L2.config(text = '20188')
    L2.grid(row = 1, column = 0)


L1 = ttk.Label(root)
L1.config(text = 'Main window')
L1.pack()

B1 = ttk.Button(root)
B1.config(text = 'New window', command = pic)
B1.pack()

root.mainloop()
