42
42
frame4 .rowconfigure (0 , weight = 1 )
43
43
frame5 .columnconfigure (0 , weight = 1 )
44
44
frame5 .rowconfigure (0 , weight = 1 )
45
-
46
45
canvas1 = Canvas (frame1 , bg = 'gray40' , width = 200 , height = 200 ,highlightthickness = 0 )
47
46
canvas1 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
48
47
canvas2 = Canvas (frame2 , bg = 'gray30' , width = 200 , height = 200 ,highlightthickness = 0 )
49
48
canvas2 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
50
49
canvas3 = Canvas (frame3 , bg = 'gray20' , width = 200 , height = 200 ,highlightthickness = 0 )
51
50
canvas3 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
52
-
53
51
texto1 = canvas1 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
54
52
texto2 = canvas2 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
55
53
texto3 = canvas3 .create_text (1 ,1 , text = '0' , font = ('Arial' ,12 ,'bold' ), fill = 'White' )
@@ -82,27 +80,20 @@ def iniciar_pausar():
82
80
if se == 59 :
83
81
se = 0
84
82
mi = mi + 1
85
-
86
83
contar = inicio .after (1 , iniciar_pausar )
87
-
88
- clik_inicio = inicio .grid_forget ()
89
-
84
+ clik_inicio = inicio .grid_forget ()
90
85
if clik_inicio is None :
91
86
stop .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
92
87
stop .config (bg = 'orange' , text = 'DETENER' )
93
88
94
-
95
89
def stop_boton ():
96
90
global contar , clik_stop
97
-
98
-
99
91
clik_stop = stop .grid_forget ()
100
92
if clik_stop is None :
101
93
inicio .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
102
94
inicio .config (bg = 'aqua' , text = 'CONTINUAR' )
103
95
inicio .after_cancel (contar )
104
96
105
-
106
97
def vueltas ():
107
98
global mi , se , ml ,click_lectura
108
99
@@ -127,9 +118,6 @@ def vueltas():
127
118
fg = 'white' , bg = 'gray10' )
128
119
click_lectura = 0
129
120
130
-
131
-
132
-
133
121
def reiniciar ():
134
122
global mi , se , ml , contar , click_lectura
135
123
mi = 0
@@ -143,7 +131,6 @@ def reiniciar():
143
131
lectura4 .configure (text = 'Lectura 4' , fg = 'white' , bg = 'gray10' )
144
132
lectura5 .configure (text = 'Lectura 5' , fg = 'white' , bg = 'gray10' )
145
133
lectura6 .configure (text = 'Lectura 6' , fg = 'white' , bg = 'gray10' )
146
-
147
134
stop .grid_forget ()
148
135
inicio .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
149
136
inicio .config (bg = 'green2' , text = 'INICIAR' )
@@ -157,39 +144,30 @@ def coordenadas():
157
144
y1 = int (y - 0.1 * x - 0.1 * y + 20 )
158
145
x2 = int (x - 0.4 * x - 0.4 * y - 15 )
159
146
y2 = int (y - 0.4 * x - 0.4 * y - 30 )
160
-
161
147
tamano = int ( y1 * 0.2 + x1 * 0.1 + 10 )
162
148
tamano_texto = int ( y1 * 0.02 + x1 * 0.02 + 3 )
163
-
164
149
#print(x1, y1, x2, y2)
165
150
canvas1 .coords (circulo1 , x1 ,y1 ,x2 ,y2 )
166
151
canvas2 .coords (circulo2 , x1 ,y1 ,x2 ,y2 )
167
152
canvas3 .coords (circulo3 , x1 ,y1 ,x2 ,y2 )
168
-
169
153
#cordenas numeros
170
154
z1 = int (x1 * 0.6 - 10 )
171
155
z2 = int (y1 * 0.6 - 10 )
172
-
173
156
#coordenadas texto
174
157
w1 = int (x1 * 0.49 + 8 )
175
158
w2 = int (y1 * 0.8 + 10 )
176
-
177
159
canvas1 .coords (texto1 , z1 , z2 )
178
160
canvas2 .coords (texto2 , z1 , z2 )
179
161
canvas3 .coords (texto3 , z1 , z2 )
180
-
181
162
canvas1 .itemconfig (texto1 , font = ('Arial' ,tamano ,'bold' ),text = mi )
182
163
canvas2 .itemconfig (texto2 , font = ('Arial' ,tamano ,'bold' ),text = se )
183
164
canvas3 .itemconfig (texto2 , font = ('Arial' ,tamano ,'bold' ), text = ml )
184
-
185
165
canvas1 .coords (texto_minutos , w1 , w2 )
186
166
canvas2 .coords (texto_segundos , w1 , w2 )
187
167
canvas3 .coords (texto_milisegundos , w1 , w2 )
188
-
189
168
canvas1 .itemconfig (texto_minutos , font = ('Arial' ,tamano_texto ,'bold' ))
190
169
canvas2 .itemconfig (texto_segundos , font = ('Arial' ,tamano_texto ,'bold' ))
191
- canvas3 .itemconfig (texto_milisegundos , font = ('Arial' ,tamano_texto ,'bold' ))
192
-
170
+ canvas3 .itemconfig (texto_milisegundos , font = ('Arial' ,tamano_texto ,'bold' ))
193
171
canvas1 .after (1000 , coordenadas )
194
172
195
173
frame4 .columnconfigure (0 , weight = 1 )
@@ -205,7 +183,6 @@ def coordenadas():
205
183
frame4 .columnconfigure (5 , weight = 1 )
206
184
frame4 .rowconfigure (0 , weight = 1 )
207
185
208
-
209
186
lectura1 = Label (frame4 , text = 'Lectura 1' , fg = 'white' , bg = 'gray10' )
210
187
lectura1 .grid (column = 0 ,row = 0 , sticky = 'nsew' )
211
188
lectura2 = Label (frame4 , text = 'Lectura 2' , fg = 'white' , bg = 'gray10' )
@@ -226,7 +203,6 @@ def coordenadas():
226
203
frame5 .columnconfigure (2 , weight = 1 )
227
204
frame5 .rowconfigure (0 , weight = 1 )
228
205
229
-
230
206
stop = Button (frame5 , text = 'DETENER' , relief = "raised" ,bd = 5 , bg = 'orange' ,
231
207
font = ('Arial' , 12 , 'bold' ), width = 20 , command = stop_boton )
232
208
stop .grid (column = 0 , row = 0 , padx = 10 , pady = 10 , sticky = 'nsew' )
@@ -246,35 +222,3 @@ def coordenadas():
246
222
coordenadas ()
247
223
ventana .mainloop ()
248
224
249
-
250
-
251
-
252
-
253
-
254
-
255
-
256
-
257
-
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
0 commit comments