Ayuda con tkinter y mas
Publicado por salvamn (62 intervenciones) el 01/11/2019 23:27:07
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
43
44
45
46
47
48
49
50
51
import tkinter as tk
from tkinter import messagebox #importar esta funcion
ventana = tk.Tk()
ventana.title("Proyecto Zero")
ventana.geometry("300x145")
ventana.resizable(False,False)
ventana.configure(background="dark slate blue") #para ponerle colo de fondo a la ventana
PrimeraPregunta = tk.Label(ventana, text="¿Que seleccion gano la copa america 2019?", bg="red", fg="gold")
PrimeraPregunta.pack(padx=5, pady=5, ipadx=5, ipady=5,fill=tk.X)
entrada = tk.Entry(ventana)
def mensaje():
messagebox.showinfo("informacion", "Incorrecto") #informacion es el titulo al presionar el boton y un mensaje simple es lo que te dira el boton
boton = tk.Button(ventana, text = "A. Chile", command = mensaje ) #variable boton
boton.pack()
boton.place(x=15, y=50)#para cambiar la posicion del boton
def mensaje2():
messagebox.showinfo("informacion 2", "Correcto")
botonDos = tk.Button(ventana, text = "B. Brasil", command = mensaje2)
botonDos.pack()
botonDos.place(x=75, y=50)
def mensaje3():
messagebox.showinfo("informacion", "Incorrecto") #informacion es el titulo al presionar el boton y un mensaje simple es lo que te dira el boton
boton = tk.Button(ventana, text = "C. Argentina", command = mensaje ) #variable boton
boton.pack()
boton.place(x=135, y=50)#para cambiar la posicion del boton
def mensaje4():
messagebox.showinfo("informacion", "Incorrecto") #informacion es el titulo al presionar el boton y un mensaje simple es lo que te dira el boton
boton = tk.Button(ventana, text = "D. Peru", command = mensaje ) #variable boton
boton.pack()
boton.place(x=220, y=50)#para cambiar la posicion del boton
ventana.mainloop()
Valora esta pregunta


0