tkinter-layout

Tkinter treeview not being placed at the right coordinates

Tkinter treeview not being placed at the right coordinates Question: I have placed a treeview widget in my tk window with .place() but it is being placed in the wrong coordinates, around 100 pixels off in both x and y, verging closer to 0. The size of the treeview is also affected, making it smaller …

Total answers: 1

Unexpected Grid behavior in Tkinter

Unexpected Grid behavior in Tkinter Question: 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 tkinter …

Total answers: 1

Tkinter Grid Spacing Issue

Tkinter Grid Spacing Issue Question: So I’m trying to create a basic text-entry thing to understand the basics of Tkinter, but when I try and grid something, if the column or row is greater than 1, it will act as if it is 1 Here is my code: from tkinter import * window = Tk() …

Total answers: 1

What else besides grid and weights are needed to make widgets proportionally sized?

What else besides grid and weights are needed to make widgets proportionally sized? Question: A Frame that has 2 rows and 1 column can be weighted. From my understanding, this will set the growth from some arbitrary position to be proportional. So something like: self.grid_columnconfigure(0, weight=1) self.grid_rowconfigure(0, weight=1) self.grid_rowconfigure(1, weight=10) # # ============ frame_header ============ …

Total answers: 1

Tkinter – Center the frame in a row

Tkinter – Center the frame in a row Question: 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 second frame shifting to the right. Here’s my code: …

Total answers: 2

Tkinter button background color is not working in mac os

Tkinter button background color is not working in mac os Question: I am trying to change the bg color of a tkinter button on my mac (catalina) but instead of getting a colored background, it is showing a blank white space in the layout. The button code I used: button_open = Button(root, width=45, bg="#82CC6C", fg="black", …

Total answers: 2