-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchecksButton.py
More file actions
42 lines (26 loc) · 1.01 KB
/
checksButton.py
File metadata and controls
42 lines (26 loc) · 1.01 KB
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
33
34
35
36
37
38
39
40
41
42
from tkinter import *
root=Tk()
root.title("ejemplo")
playa=IntVar()
montania=IntVar()
turismoRural=IntVar()
def opcionesViaje():
opcionEscogida=""
if (playa.get()==1):
opcionEscogida+="Playa"
if (montania.get()==1):
opcionEscogida+="Montania"
if (turismoRural.get()==1):
opcionEscogida+="Turismo Rural"
textoFinal.config(text=opcionEscogida)
#foto=PhotoImage(file="patricio.png")#r'C:\Users\KrisOP\Desktop\Phyton\Interfaces\ff.ico'
#Label(root,image=foto).pack()
frame=Frame(root)
frame.pack()
Label(frame,text="Elije destinos", width=50).pack()
Checkbutton(root,text="Playa",variable=playa,onvalue=1,offvalue=0,command=opcionesViaje).pack()#cuando este seleccionado el valor vale 1 y sino vale 0
Checkbutton(root,text="Montania",variable=montania,onvalue=1,offvalue=0,command=opcionesViaje).pack()
Checkbutton(root,text="Turismo Rural",variable=turismoRural,onvalue=1,offvalue=0,command=opcionesViaje).pack()
textoFinal=Label(frame)
textoFinal.pack()
root.mainloop()