This repository has been archived on 2019-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
s1-tp/S1/Echecs/tkResize.py
Geoffrey Frogeye 246f65993e Séparation en différents fichiers
- Il faut désormais lancer app.py
- Nettoyage des fichiers inutiles
2014-12-12 19:49:58 +01:00

37 lines
1.2 KiB
Python

import tkinter.ttk
from tkinter.constants import *
class Application(tkinter.ttk.Frame):
@classmethod
def main(cls):
tkinter.NoDefaultRoot()
root = tkinter.Tk()
app = cls(root)
app.grid(sticky=NSEW)
root.grid_columnconfigure(0, weight=1)
root.grid_rowconfigure(0, weight=1)
root.resizable(True, True)
root.mainloop()
def __init__(self, root):
super().__init__(root)
self.create_widgets()
self.grid_widgets()
self.grid_columnconfigure(0, weight=1)
def create_widgets(self):
self.set_timer = tkinter.ttk.Entry(self, text="Dummy")
self.start = tkinter.ttk.Button(self, text='Start')
self.display1 = tkinter.ttk.Label(self, text='Dummy')
self.display2 = tkinter.ttk.Label(self, text='Dummy')
def grid_widgets(self):
options = dict(sticky=NSEW, padx=3, pady=4)
self.set_timer.grid(column=0, row=0, **options)
self.start.grid(column=0, row=1, **options)
self.display1.grid(column=0, row=2, **options)
self.display2.grid(column=0, row=3, **options)
if __name__ == '__main__':
Application.main()