Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter.ttk import *
- def desplegarMensaje():
- area_texto.insert(INSERT,f"El texto ingreso es {entrada.get()}\n")
- area_texto.insert(INSERT,f"La opción seleccionada es {combo.get()}\n")
- ventana = Tk()
- ventana.title("Ventana de prueba")
- frame = Frame(ventana,borderwidth=2)
- frame.pack()
- etiqueta = Label(frame,text="Soy un primer mensaje")
- etiqueta.pack()
- entrada = Entry(frame)
- entrada.pack()
- area_texto = Text(frame,bg="lightgreen")
- area_texto.pack()
- combo = Combobox(frame,
- values=[
- "January",
- "February",
- "March",
- "April"])
- combo.current(1)
- combo.pack()
- seleccion = Spinbox(frame,from_=0,to=20)
- seleccion.set(1)
- seleccion.pack()
- boton = Button(frame, text="Aceptar",command=desplegarMensaje)
- boton.pack()
- ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement