Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Silkvine001 committed Jul 17, 2024
1 parent 0992f8d commit f643ee8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
40 changes: 33 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Lista_b = 0
matriz_binaria_R = []

def RepresentarMatriz(Lista_a, Lista_b):
def RepresentarMatriz(Lista_a, Lista_b, ListasString_Union, RelacionStringFormat):
if Lista_a == 0 and Lista_b == 0:
ErrorNR = Toplevel()
ErrorNR.geometry("380x160")
Expand Down Expand Up @@ -52,13 +52,18 @@ def RepresentarMatriz(Lista_a, Lista_b):
print(matriz_binaria_R[j][i], end=' | ')
print()#Salto de linea

print()#Salto de linea
MatrizPlantilla = ttk.Label(frame2, text=MatrizString(Lista_a, Lista_b, matriz_binaria_R))
print()#Salto de linea
A_B_Label = ttk.Label(frame2, text=ListasString_Union, foreground="white", font=("Ariel", 13, "bold"))
RelacionLabel = ttk.Label(frame2, text=RelacionStringFormat, foreground="white", font=("Ariel", 13, "bold"))
A_B_Label.place(relx=0.5, rely=0.05, anchor="center")
RelacionLabel.place(relx=0.5, rely=0.1, anchor="center")
MatrizPlantilla = ttk.Label(frame2, text=MatrizString(Lista_a, Lista_b, matriz_binaria_R), font=("Consolas", 16, "bold"))
MatrizPlantilla.place(relx=0.5, rely=0.5, anchor="center")


def PropiedadesRel(RelacionR, Lista_a, Lista_b):

global RelacionStringFormat
global ListasString_Union
if Lista_a == 0 and Lista_b == 0:
ErrorNR = Toplevel()
ErrorNR.geometry("380x160")
Expand All @@ -78,6 +83,17 @@ def PropiedadesRel(RelacionR, Lista_a, Lista_b):
simetria_R_Label = ttk.Label(frame2, text="Simetria: False", foreground="gray", font=("Ariel", 25))
asimetria_R_Label = ttk.Label(frame2, text="Asimetria: False", foreground="gray", font=("Ariel", 25))
antisimetria_R_Label = ttk.Label(frame2, text="Antisimetria: False", foreground="gray", font=("Ariel", 25))
ListasString_A = ",".join(Lista_a)
ListasString_B = ",".join(Lista_b)
RelacionSring = str(RelacionR).strip('[]').replace("'", "")
my_string_var = StringVar()
RelacionStringFormat = "R = {" + RelacionSring + "}"
ListasString_Union = "A = {" + ListasString_A + "}" + " " + " B = {" + ListasString_B + "}"
print("test: ", ListasString_Union)
A_B_Label = ttk.Label(frame2, text=ListasString_Union, foreground="white", font=("Ariel", 16, "bold"))
RelacionLabel = ttk.Label(frame2, text=RelacionStringFormat, foreground="white", font=("Ariel", 16, "bold"))
A_B_Label.place(relx=0.5, rely=0.05, anchor="center")
RelacionLabel.place(relx=0.5, rely=0.1, anchor="center")
reflexividad_R_Label.place(relx=0.5, rely=0.7, anchor="center")
irreflexivilidad_R_Label.place(relx=0.5, rely=0.6, anchor="center")
transitividad_R_Label.place(relx=0.5, rely=0.5, anchor="center")
Expand Down Expand Up @@ -243,6 +259,14 @@ def MatrizString(Lista_a, Lista_b, matriz_binaria_R):

def GenerarArreglo(ListaSeleccion_f, titulo_relaciones):
global RelacionR
global RelacionStringFormat
global ListasString_Union
ListasString_A = ",".join(Lista_a)
ListasString_B = ",".join(Lista_b)
RelacionSring = str(RelacionR).strip('[]').replace("'", "")
my_string_var = StringVar()
RelacionStringFormat = "R = {" + RelacionSring + "}"
ListasString_Union = "A = {" + ListasString_A + "}" + " " + " B = {" + ListasString_B + "}"
RelacionR = list(ListaSeleccion_f.get(0, "end"))

for i in range(len(RelacionR)):
Expand Down Expand Up @@ -334,6 +358,8 @@ def click_boton():

# VENTANA RELACIONES
def relaciones():
global RelacionStringFormat
global ListasString_Union
# se remueve el texto de bienvenida
for widget in frame2.winfo_children():
widget.destroy()
Expand Down Expand Up @@ -422,8 +448,8 @@ def relaciones():
# ventana principal
root = Tk()
root.title("Hecho por: Jonathan Salazar")
root.minsize(820, 650)
root.maxsize(1280, 720)
root.minsize(1280, 720)
#root.maxsize(1280, 720)
root.resizable(False, False)

root.rowconfigure(0, weight=1)
Expand All @@ -446,7 +472,7 @@ def relaciones():
rep_lab.grid(row=3, column=0, padx=10, pady=10)

# el resto de los botones
button = ttk.Button(frame1, text="Matriz", style="Button.TButton", command=lambda: RepresentarMatriz(Lista_a, Lista_b))
button = ttk.Button(frame1, text="Matriz", style="Button.TButton", command=lambda: RepresentarMatriz(Lista_a, Lista_b, RelacionStringFormat, ListasString_Union))
button.grid(row=4, column=0, padx=10, pady=10, sticky="ew")
button = ttk.Button(frame1, text="Sagital", style="Button.TButton", command=click_boton)
button.grid(row=5, column=0, padx=10, pady=10, sticky="ew")
Expand Down
16 changes: 16 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import tkinter as tk
from tkinter import ttk

# Crear una ventana
ventana = tk.Tk()
ventana.title("Ejemplo de etiqueta con cadena")

# Variable de tipo cadena
mi_cadena = "¡Hola, mundo!"

# Crear una etiqueta y mostrar la cadena
etiqueta = ttk.Label(ventana, text=mi_cadena, font=("Arial", 14))
etiqueta.pack()

# Ejecutar el bucle principal de la aplicación
ventana.mainloop()

0 comments on commit f643ee8

Please sign in to comment.