|
4 | 4 |
|
5 | 5 | from tkinter import Canvas, Button, Frame, Label,Tk
|
6 | 6 |
|
7 |
| - |
8 | 7 | ventana = Tk()
|
9 | 8 | ventana.config(bg='black')
|
10 | 9 | ventana.geometry('500x250')
|
11 | 10 | ventana.title('Cronometro')
|
12 | 11 | ventana.minsize(width=500, height=250)
|
13 | 12 |
|
14 |
| - |
15 | 13 | ventana.columnconfigure(0,weight=2)
|
16 | 14 | ventana.rowconfigure(0,weight=2)
|
17 | 15 | ventana.columnconfigure(1, weight=2)
|
|
23 | 21 | ventana.columnconfigure(1,weight=2)
|
24 | 22 | ventana.rowconfigure(1,weight=1)
|
25 | 23 |
|
26 |
| - |
27 | 24 | frame1 = Frame(ventana)
|
28 | 25 | frame1.grid(column=0,row=0,sticky='snew')
|
29 | 26 | frame2 = Frame(ventana)
|
|
34 | 31 | frame4.grid(row=1, columnspan=3, sticky='snew')
|
35 | 32 | frame5 = Frame(ventana, bg='black')
|
36 | 33 | frame5.grid(row=2, columnspan=3, sticky='snew')
|
37 |
| - |
38 | 34 | #---
|
39 |
| - |
40 | 35 | frame1.columnconfigure(0, weight=1)
|
41 | 36 | frame1.rowconfigure(0, weight=1)
|
42 | 37 | frame2.columnconfigure(0, weight=1)
|
|
48 | 43 | frame5.columnconfigure(0, weight=1)
|
49 | 44 | frame5.rowconfigure(0, weight=1)
|
50 | 45 |
|
51 |
| - |
52 | 46 | canvas1= Canvas(frame1, bg='gray40', width=200, height =200,highlightthickness=0)
|
53 | 47 | canvas1.grid(column=0,row=0, sticky='nsew')
|
54 | 48 | canvas2= Canvas(frame2, bg='gray30', width=200, height =200,highlightthickness=0)
|
55 | 49 | canvas2.grid(column=0,row=0, sticky='nsew')
|
56 | 50 | canvas3= Canvas(frame3, bg='gray20', width=200, height =200,highlightthickness=0)
|
57 | 51 | canvas3.grid(column=0,row=0, sticky='nsew')
|
58 | 52 |
|
59 |
| - |
60 | 53 | texto1 = canvas1.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
|
61 | 54 | texto2 = canvas2.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
|
62 | 55 | texto3 = canvas3.create_text(1,1, text='0', font=('Arial',12,'bold'), fill= 'White')
|
|
72 | 65 | circulo2 = canvas2.create_oval(10,10,100,100, outline='medium spring green',width=10)
|
73 | 66 | circulo3 = canvas3.create_oval(10,10,100,100, outline='magenta2',width=10)
|
74 | 67 |
|
75 |
| - |
76 | 68 | mi = 0
|
77 | 69 | se = 0
|
78 | 70 | ml = 0
|
|
81 | 73 | clik_stop = 0
|
82 | 74 | clik_inicio =0
|
83 | 75 |
|
84 |
| - |
85 | 76 | def iniciar_pausar():
|
86 | 77 | global mi, se, ml, contar, clik_stop, clik_inicio
|
87 | 78 | ml = ml + 1
|
@@ -158,8 +149,6 @@ def reiniciar():
|
158 | 149 | inicio.config(bg= 'green2', text='INICIAR')
|
159 | 150 |
|
160 | 151 |
|
161 |
| - |
162 |
| - |
163 | 152 | def coordenadas():
|
164 | 153 | x = canvas1.winfo_width()
|
165 | 154 | y = canvas1.winfo_height()
|
@@ -203,8 +192,6 @@ def coordenadas():
|
203 | 192 |
|
204 | 193 | canvas1.after(1000, coordenadas)
|
205 | 194 |
|
206 |
| - |
207 |
| - |
208 | 195 | frame4.columnconfigure(0, weight= 1)
|
209 | 196 | frame4.rowconfigure(0, weight= 1)
|
210 | 197 | frame4.columnconfigure(1, weight= 1)
|
@@ -256,9 +243,7 @@ def coordenadas():
|
256 | 243 | font=('Arial', 12, 'bold'), width =20, command = reiniciar)
|
257 | 244 | fin.grid(column=2, row=0, padx =10, pady=10, sticky='nsew')
|
258 | 245 |
|
259 |
| - |
260 | 246 | coordenadas()
|
261 |
| - |
262 | 247 | ventana.mainloop()
|
263 | 248 |
|
264 | 249 |
|
|
0 commit comments