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
| # -*- coding: iso-8859-1 -*-
import os, re, sys, Tix, fpformat
from datetime import date
from PIL import Image, ImageTk
import Tkinter as Tk
def new():
newWindow=Tk.Toplevel()
newWindow.grab_set()
newWindow.focus_set()
newWindow.geometry("200x100")
newWindow.resizable(False,False)
newWindow.title("Nouvelle fenetre")
testEntry=Tk.Entry(newWindow, width=8, justify='right')
testEntry.pack()
buttonPrint=Tk.Button(newWindow,text="Afficher contenu de l'entry",command=afficher)
buttonPrint.pack()
def afficher():
print testEntry.get()
mainWindow=Tix.Tk()
mainWindow.geometry("200x200")
mainWindow.resizable(False,False)
mainWindow.title("Fenetre principale")
buttonNouveau=Tk.Button(mainWindow,text="Nouveau lot",command=new)
buttonNouveau.pack()
mainWindow.mainloop() |
Partager