Created
February 13, 2020 04:07
-
-
Save lfalanga/de6fca532e91f6690ee4b4e609157bd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from tkinter import messagebox | |
root = Tk() | |
root.title("Tarea POO") | |
root.resizable(FALSE, FALSE) | |
topFrame = Frame(root) | |
topFrame.pack() | |
bottomFrame = Frame(root) | |
bottomFrame.pack(side=BOTTOM) | |
# Label: Titulo del Formulario | |
Label(topFrame, text="Ingrese sus datos", width=54, height=2, bg="green", fg="white").grid(row=0, columnspan=3) | |
# Frame: Separador: Titulo - Formulario | |
separador1 = Frame(topFrame, height=9) | |
separador1.grid(row=1, columnspan=3) | |
# Label: Etiquetas correspondientes a los campos | |
Label(topFrame, text="Título:").grid(row=2, sticky=W, padx=9, pady=3) | |
Label(topFrame, text="Ruta:").grid(row=3, sticky=W, padx=9, pady=3) | |
Label(topFrame, text="Descripción:").grid(row=4, sticky=W, padx=9, pady=3) | |
# Entry: Creando los campos correspondientes | |
e1 = Entry(topFrame, width=36) | |
e2 = Entry(topFrame, width=36) | |
e3 = Entry(topFrame, width=36) | |
e1.grid(row=2, column=1, columnspan=2, padx=9, pady=3) | |
e2.grid(row=3, column=1, columnspan=2, padx=9, pady=3) | |
e3.grid(row=4, column=1, columnspan=2, padx=9, pady=3) | |
# Button: Creando los botones | |
def cb_alta(): | |
messagebox.showinfo("Atención!", "cb_alta") | |
def cb_sorpresa(): | |
messagebox.showinfo("Atención!", "cb_sorpresa") | |
b1 = Button(bottomFrame, | |
text="Alta", | |
command=cb_alta, | |
activebackground="black", | |
activeforeground="white", | |
bg="dark grey", | |
fg="white" | |
) | |
b2 = Button(bottomFrame, | |
text="Sorpresa", | |
command=cb_sorpresa, | |
activebackground="black", | |
activeforeground="white", | |
bg="dark grey", | |
fg="white" | |
) | |
b1.grid(row=0, column=0, pady=9) | |
b2.grid(row=0, column=1, pady=9) | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment