Widgets Positioned With Grid Do Not Show Unless I use Pack Buy Not Supposed to Use Grid and Pack in Same Class?
In the code below if I do not use pack() the widgets do not show but grid and pack are not supposed to be used in the same class. How to write this correctly without using pack?
Widgets Positioned With Grid Do Not Show Unless I use Pack Buy Not Supposed to Use Grid and Pack in Same Class?
In the code below if I do not use pack() the widgets do not show but grid and pack are not supposed to be used in the same class. How to write this correctly without using pack?
Me ask is How to draw a windows for customtkinter in python Treeview
import customtkinter as ctk import pandas as pd from tkinter import filedialog, messagebox import threading # Função para carregar e exibir o arquivo Excel def load_excel(): file_path = filedialog.askopenfilename(filetypes=[(“Excel files”, “*.xlsx”)]) if file_path: global df df = pd.read_excel(file_path) if ‘Matrículas’ in df.columns: display_table(df) else: messagebox.showerror(“Erro”, “O arquivo selecionado não segue o padrão esperado.”) # Função para exibir os dados na Treeview def display_table(df): for i, row in df.iterrows(): tree.insert(“”, “end”, values=list(row)) # Função para validar e destacar matrículas inválidas def validate_data(): for i, item in enumerate(tree.get_children()): matricula = tree.item(item)[‘values’][0] if len(str(matricula)) != 5 or not str(matricula).isdigit(): tree.item(item, tags=(“invalid”,)) else: tree.item(item, tags=(“valid”,)) tree.tag_configure(‘invalid’, background=’red’) tree.tag_configure(‘valid’, background=’white’) # Função para atualizar o DataFrame e salvar o arquivo corrigido def update_and_save(): for i, item in enumerate(tree.get_children()): df.iloc[i, 0] = tree.item(item)[‘values’][0] # Assumindo que a coluna de matrículas é a primeira df.to_excel(“corrected_file.xlsx”, index=False) messagebox.showinfo(“Sucesso”, “Arquivo salvo com sucesso!”) # Configuração da interface CustomTkinter app = ctk.CTk() app.geometry(“800×600″) load_button = ctk.CTkButton(app, text=”Carregar Arquivo”, command=load_excel) load_button.pack(pady=20) tree = ctk.CTkTreeview(app, columns=(“Matrícula”,)) tree.heading(“#0″, text=””) tree.heading(“Matrícula”, text=”Matrícula”) tree.pack(pady=20) validate_button = ctk.CTkButton(app, text=”Validar Matrículas”, command=validate_data) validate_button.pack(pady=20) save_button = ctk.CTkButton(app, text=”Salvar Correções”, command=update_and_save) save_button.pack(pady=20) app.mainloop()
Listbox not showing or 2 forms tkinter
I call another form with this one, and the listboxes of the second form are either not displayed when I add the self.destroy(), in the function where it is displayed in two forms when I remove the line. Do you have any clues? I have been looking for days but have found nothing.
Tkinter DoubleVar set empty value
How can I set an empty value in a Tkinter DoubleVar()
?
How set the widget size to fit all the width and height of the main window?
I’m trying to make a small app in Tkinter and i want to insert a notebook after an connexion inside my main window.
Tkinter – trace_add() not executing the validation method
Tkinter menu executes New_Debtor_Acc in another module. New_Debtor_Acc is also use tkinter. The label has a trace_add() to validate data entered interactively. But it will not execute, using the normal “def New_Debtor_Acc”.
Why is my GUI program in 2 different windows?
My GUI program made with tkinter in python is in 2 different windows
tkinter not running on ubuntu
When I try to import tkinter I get the error message: Python 3.12.3 (main, May 25 2024, 22:44:21) [GCC 13.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
Use dotenv LD_LIBRARY_PATH in python-tkinter
I am new to python-tkinter. I am trying to load a library in tkinter tcl interpreter. However, I am not able to use environment variable LD_LIBRARY_PATH which I am setting using dotenv.