-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEjercicio_10_2.py
More file actions
26 lines (20 loc) · 805 Bytes
/
Ejercicio_10_2.py
File metadata and controls
26 lines (20 loc) · 805 Bytes
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
import tkinter
from tkinter import ttk
# Crea la ventanay y la cuadrícula
window = tkinter.Tk()
window.columnconfigure(0, weight=1)
# Crea el label para el formulario de selección
label1 = ttk.Label(window, text='Selecciona el número de habitaciones:')
# Crea la lógica del checkbox
value1 = tkinter.BooleanVar()
value2 = tkinter.BooleanVar()
value3 = tkinter.BooleanVar()
check1 = ttk.Checkbutton(window, text = "1", variable = value1)
check2 = ttk.Checkbutton(window, text = "2", variable = value2)
check3 = ttk.Checkbutton(window, text = "3", variable = value3)
# Pinta los elementos en el grid
label1.grid(column=0, row=0, pady=5, padx=5)
check1.grid(column=0, row=1, pady=5, padx=5)
check2.grid(column=0, row=2, pady=5, padx=5)
check3.grid(column=0, row=3, pady=5, padx=5)
window.mainloop()