1919
2020for i in range (0 ,24 ):
2121 lista_horas .append (i )
22-
2322for i in range (0 ,60 ):
2423 lista_minutos .append (i )
25-
2624for i in range (0 ,60 ):
2725 lista_segundos .append (i )
2826
29-
3027texto1 = Label (ventana , text = 'Hora' , bg = 'black' , fg = 'magenta' , font = ('Arial' ,12 , 'bold' ))
3128texto1 .grid (row = 1 , column = 0 , padx = 5 , pady = 5 )
3229texto2 = Label (ventana , text = 'Minutos' , bg = 'black' , fg = 'magenta' , font = ('Arial' ,12 , 'bold' ))
3330texto2 .grid (row = 1 , column = 1 , padx = 5 , pady = 5 )
3431texto3 = Label (ventana , text = 'Segundos' , bg = 'black' , fg = 'magenta' , font = ('Arial' ,12 , 'bold' ))
3532texto3 .grid (row = 1 , column = 2 , padx = 5 , pady = 5 )
3633
37-
3834combobox1 = ttk .Combobox (ventana , values = lista_horas , style = "TCombobox" , justify = 'center' ,width = '12' , font = 'Arial' )
3935combobox1 .grid (row = 2 , column = 0 , padx = 15 , pady = 5 )
4036combobox1 .current (0 )
4541combobox3 .grid (row = 2 , column = 2 , padx = 15 , pady = 5 )
4642combobox3 .current (0 )
4743
48-
4944style = ttk .Style ()
5045style .theme_create ('combostyle' , parent = 'alt' ,settings = {'TCombobox' :
5146 {'configure' :
6055ventana .option_add ('*TCombobox*Listbox*selectBackground' , 'green2' )
6156ventana .option_add ('*TCombobox*Listbox*selectForeground' , 'black' )
6257
63-
6458alarma = Label (ventana , fg = 'violet' , bg = 'black' , font = ('Radioland' , 20 ))
6559alarma .grid (column = 0 , row = 3 , sticky = "nsew" , ipadx = 5 , ipady = 20 )
6660repetir = Label (ventana , fg = 'white' , bg = 'black' , text = 'Repetir' , font = 'Arial' )
6963cantidad .grid (row = 3 , column = 2 , padx = 5 , pady = 5 )
7064cantidad .current (0 )
7165
72-
73-
7466def obtener_tiempo ():
7567 x_hora = combobox1 .get ()
7668 x_minutos = combobox2 .get ()
@@ -83,10 +75,8 @@ def obtener_tiempo():
8375 hora_total = (hora + ' : ' + minutos + ' : ' + segundos )
8476 texto_hora .config (text = hora_total , font = ('Radioland' , 25 ))
8577
86-
8778 hora_alarma = x_hora + ' : ' + x_minutos + ' : ' + x_segundos
8879 alarma ['text' ]= hora_alarma
89-
9080 #condicion:
9181 if int (hora ) == int (x_hora ):
9282 if int (minutos ) == int (x_minutos ):
@@ -96,11 +86,8 @@ def obtener_tiempo():
9686 messagebox .showinfo (message = hora_alarma , title = "Alarma" )
9787
9888 texto_hora .after (100 , obtener_tiempo )
99-
100-
10189texto_hora = Label (ventana , fg = 'green2' , bg = 'black' )
10290texto_hora .grid (columnspan = 3 , row = 0 ,sticky = "nsew" , ipadx = 5 , ipady = 20 )
103-
10491obtener_tiempo ()
10592
10693ventana .mainloop ()
0 commit comments