Questions tagged [tkinter-layout]
378 questions
2
votes
1 answer
TclError: bad window path name (Python)
In one of the views there is a button for close the actual view, and it works, but when I try to open again the view it shows me the next error:
Exception in Tkinter callback
Traceback (most recent call last):
File…

Hamilton Tobon Mosquera
- 83
- 1
- 2
- 10
2
votes
5 answers
Tkinter "place" geometry manager not working
I've been learning Python from an e-book. Right now I am learning about the Tkinter module
The book suggested running the following code. However, it does not work as it should. Any ideas why?
from Tkinter import *
window =…

midkin
- 1,503
- 2
- 18
- 23
1
vote
2 answers
How to get rid of spaces ? tkinter
I want to make "=" button higher so it cover the space above(also wanna make "." wider so it also covers space)
what I am getting
so I want to join the cell above "=" and cell next to ".", wanna make one "big" button
window =…

Eric
- 11
- 2
1
vote
0 answers
Adding an image as background in a Tkinter Window
I have a Python script that creates three Tkinter windows. I want to add an image as the background and display all other widgets on top of it. Can anyone suggest how to achieve this in Tkinter?
import tkinter as tk, pandas as pd, io
from tkinter…

Param Dhingana
- 63
- 5
1
vote
1 answer
Unexpected Grid behavior in Tkinter
I am coding a game in Python with tkinter. The basic functionality is that an image is displayed but it's covered with a grid of boxes that can be destroyed. I've written a linear version of the code that is as simplified as I can get it:
from…

Yamiko Hikari
- 77
- 7
1
vote
0 answers
The treeview border got hidden after applying this style
I have applied this style to tkinter treeview but the data separator line got vanished
style_def = ttk.Style(frametree)
style_def.configure("Treeview",
background="#FFDEAD",fieldbackground="#FFDEAD", foreground="Black",
font=(None, 14),…

Prashant Priyadarshi
- 27
- 5
1
vote
1 answer
self.tk.call( _tkinter.TclError: image "pyimage3" doesn't exist
r_login = Tk()
r_login.title("Admin Login - Student Management System")
r_login.geometry("1280x720")
bg2 = PhotoImage(file="002.png")
lbl_bg2 = Label(r_login, image=bg2)
lbl_bg2.pack()
icon = PhotoImage(file='logo.png')
r_login.iconphoto(True,…

ADITYA GHOSH
- 25
- 4
1
vote
1 answer
Python Tkinter Grid Expand to window
I have a notebook that I placed in grid (0;0). I want to the notebok to fill the entire screen even if its content (frames) would not fill the screen.
class App(Tk):
def __init__(self) -> None:
super().__init__()
# Widgets
…

Latex User 101
- 11
- 1
1
vote
1 answer
Centering components in Tkinter Grid Layout not working
I want the components in this window to be center aligned, but no matter how I try I am unable to bring those components to the center.
Here is my code and the attached screenshot of the window when I run the code.
import tkinter.filedialog
import…

Sriram M
- 13
- 4
1
vote
2 answers
Tkinter - Center the frame in a row
Hello I am struggling with tkinter grid_columnconfigure. I am creating window with 3 frame. I want to center second frame. I found grid_rowconfigure(0, weight=1) and grid_columnconfigure(0, weight=1). They are working but when I add third frame, my…

Seminet
- 69
- 6
1
vote
1 answer
Tkinter grid vs pack manager window shrink
I have an example code that use the Tkinter grid manager for creating and allocating four…

Gregosh
- 17
- 7
1
vote
0 answers
TkCalendar goes out of screen when trying to select date in Python DateEntry
I am facing an issue where when I want to select a date from a tkCalendar using DateEntry but the the Calendar goes out of screen.
Image showing Calendar goes out of screen
I saw a few solutions which I have added the link to below.
Tkcalendar:…

Ruchi M
- 11
- 1
1
vote
0 answers
keeping a horizontal scrollbar to a canvas with a image to view the image in tkinter
I am trying to keep a horizontal scrollbar to a canvas with an image to view the image which I want to stretch horizontally. When I grid the scrollbar, it displays the content in a different way.
Here is the Tkinter code,
import os
import tkinter as…

Dr.Die_OXide
- 300
- 2
- 18
1
vote
1 answer
Unable to Show Label Image inside a Frame using tkinter
'''
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog as fd
from PIL import ImageTk, Image
root = tk.Tk()
root.geometry("1255x944")
toplevel_frame = ttk.Frame(root)
Title_frame = ttk.Frame(toplevel_frame)
img=…

user18243542
- 11
- 1
1
vote
2 answers
Tkinter grid manager bad screen distance
I tried using the Grid manager and wanted to place 4 buttons in 2 rows and 2 columns with this code:
button1 = Button(window, wrap="Button1", width=10)
button1.grid(row=0, column=0)
button1.pack()
button2 = Button(window, wrap="Button2",…

Collin Lehmann
- 59
- 1
- 6