1
to tell the truth these two geometries are very complicated, but unfortunately I need to use this 2 in this project. So come on.
first follows the code:
from tkinter import*
from tkinter.ttk import *
class principal:
def __init__(self):
principal = Tk()
principal.geometry("860x540+75+75")
principal.overrideredirect(True)
esquerda = PhotoImage(file="altura.png")
ladoesquerdo = Label(principal, background="WHITE", image=esquerda)
ladoesquerdo.esquerda = esquerda
ladoesquerdo.pack(side=LEFT, padx=5)
cima = PhotoImage(file="largura.png")
partedecima = Label(principal, background="WHITE", image=cima)
partedecima.cima = cima
partedecima.pack(side=TOP)
baixo = PhotoImage(file="largura.png")
partedebaixo = Label(principal, background="WHITE", image=baixo)
partedebaixo.baixo = baixo
partedebaixo.pack(side=BOTTOM)
direita = PhotoImage(file="altura.png")
ladodireito = Label(principal, background="WHITE", image=direita)
ladodireito.direito = direita
ladodireito.pack(side=RIGHT, padx=5)
#:::::::::: CADASTRO ::::::::::::
framedoscadastros = LabelFrame(principal, height=475, width=400, text="::::::::::::::: Cadastrar :::::::::::::::").pack(side=LEFT)
nome0 = Label(framedoscadastros, text="Nome: ").grid(row=0, column=0)
nome1 = Entry(framedoscadastros, width=20).grid(row=0, column=1)
sobre0 = Label(framedoscadastros, text="Sobrenome: ").grid(row=1, column=0)
sobre1 = Entry(framedoscadastros, width=20).grid(row=1, column=1)
telefone0 = Label(framedoscadastros, text="Telefone: ").grid(row=2, column=0)
telefone1 = (framedoscadastros, width).grid(row=2, column=1)
nserie0 = Label(framedoscadastros, text="Nº de Série: ").grid(row=3, column=0)
nserie1 = Entry(framedoscadastros, width=20).grid(row=3, column=1)
problema0 = Label(framedoscadastros, text="Problema: ").grid(row=4, column=0)
problema1 = Text(framedoscadastros, width=20, height=4).grid(row=4, column=1)
nome1 = Label(framedoscadastros, text="Nome: ").grid(row=0, column=0)
#::::::::::: BUSCAR :::::::::::::
framedebuscarcadastros = LabelFrame(principal, height=475, width=400, text="::::::::::::::: Buscar Cadastros :::::::::::::::").pack(side=RIGHT)
principal.mainloop
principal()
My code is as clear as it could be, the problem is also very clear, but I don’t know how to fix it. The pertinent error is:
Tkinter.Tclerror: cannot use Geometry manager grid Inside . which already has Slaves Managed by pack
someone can help me?
Creates a Frame in each execution block
– jhon lenon tavares