All Questions
Tagged with grid-layout tkinter
53
questions
25
votes
4
answers
101k
views
How to horizontally center a widget using grid()?
I am using grid() to place widgets in a tkinter window. I am trying to put a label on the horizontal center of a window and have it stay there, even if the window is resized. How could I go about ...
15
votes
1
answer
48k
views
Tkinter grid fill empty space
I did search for a lot of examples before posting but still can't properly use the tkinter grid.
What I want:
my code:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
b1 = ttk.Button(...
12
votes
2
answers
59k
views
Tkinter.grid spacing options?
I'm new to Tkinter, and I tried creating an app with the grid layout manager. However, I can't seem to find a way to utilize it the way I want to. What I need to do is simulate a grid full of 'cells' ...
7
votes
3
answers
12k
views
Tkinter Grid Dynamic Layout
I am wanting to create a grid layout, with a grid that fills the first row until it runs out of space in the window, and will dynamically move items to the row below (like text line-wrapping). As the ...
3
votes
1
answer
3k
views
Python: Getting started with tk, widget not resizing on grid?
I'm just getting started with Python's Tkinter/ttk and I'm having issues getting my widgets to resize when I use a grid layout. Here's a subset of my code which exhibits the same issue as the full ...
2
votes
1
answer
2k
views
Why is TKinter OptionMenu changing the size of it's parent?
I have this GUI program, and one of the Frames has an OptionMenu in it. Whenever I select something in the OptionMenu, it resizes the parent frame, even though it has more than enough room to fit in ...
2
votes
1
answer
512
views
Adding label to tkinter widget changes entire layout
I am making a python text editor, and I am now busy with the find function.
Then when the last occurance of the users input is found, it jumps back to the beginning again, and it shows the text 'Found ...
2
votes
0
answers
134
views
Aligning entries in nested grid layouts in tkinter
I have the following code:
from tkinter import *
class GUI(Tk):
def __init__(self, *args, **kw):
super().__init__(*args, **kw)
self.frame = Frame(self)
self.frame.pack(fill=BOTH, ...
1
vote
1
answer
3k
views
Change the position of widget within a grid?
What I need to know is if there is a way to put a widget into a different grid cell after already gridding it. The reason I need to do this is because I am making a tkinter program in python with ...
1
vote
1
answer
2k
views
How to stretch cell horizontally using grid in Tkinter?
I was using tkinter to make simple GUI and I wanted to make it too simple and cool so I wanted to this label ********** to be filled in screen but the there is no option for fill in grid like in pack ...
1
vote
1
answer
2k
views
Tkinter treeview widgets not properly aligned/added space between widgets
I am working on this table in tkinter made from a bunch of treeveiw widgets. The idea is to get a table where I can add lines, select lines and edit them. In the code below you can add lines to the ...
1
vote
1
answer
7k
views
Python grid columnspan
I want to fill the hole column with a text widgets using grid columnspan.Is that possible?
import tkinter
root = tkinter.Tk()
text = tkinter.Text(root)
text.insert('end','Text')
text.grid(row=0,...
1
vote
2
answers
143
views
Tkinter: maintaining button distance when resizing window
I am switching the layout manager for my tkinter GUI. I was using place instead of grid because it was easier for me in the first place, altough I knew it would not be very compatible. Now I noticed ...
1
vote
1
answer
59
views
Odd interaction between grid_propagate and columnspan
Assigning a columnspan (other than 1) to a child object appears to negate the effects of uniform=1 and grid_propagate(False). Here is a simple example of what I mean (click the text to toggle back and ...
1
vote
1
answer
588
views
How to create a Dynamic Scrollable Grid on tkinter
When I say a dynamic grid I'm saying a grid that adjusts the number of columns(like bootstrap) according to the window width, so it must adjust the "cards" accordingly, and when I say ...
1
vote
1
answer
2k
views
How to grid a ttk Notebook containing two ttk Treeviews so it expands to fill its designated grid cell?
I'm having trouble laying out two same ttk.Treeview widgets using ttk.Notebook and grid layout manager. When I'm working with only one treeview (placed in a labelframe, that is placed in a frame (...
1
vote
1
answer
390
views
Python - Widget alignment when using multiple frames
I'm facing some trouble aligning tkinter widgets when located in different frames, as shown
I have 3 frames: main_frame - colored in blue, containing 3 subframes: buttons_frame,timers_frame,...
1
vote
1
answer
3k
views
How can I evenly divide space between two frames using the grid geometry manager in tkinter?
I have a tkinter application I'm trying to create. I've deiced to use the grid geometry manger instead of pack. It has been working well so far, but I've come across a strange problem.
The basic ...
1
vote
2
answers
3k
views
Tkinter: right align Labels within stretched LabelFrames using grid
Using grid in tkinter, I'm trying to align a set of frames (I would love to post a picture, but I'm not allowed.)
I've two outer LabelFrames of different sizes and on top of each other which I'd like ...
1
vote
1
answer
129
views
separate random numbers in tkinter [closed]
This code showed me some random numbers on the right side on my screen.
from Tkinter import *
import math
from random import randrange
number=Tk()
number.geometry("1308x720")
number.config(bg="black"...
1
vote
1
answer
2k
views
Why does the 'ipady' option in the tkinter.grid() method only add space below a widget?
Below is a code to show the issue. Label1 shows that I need to use pady to displace Label1 by 10 pixels. Label2 shows the default effect of ipady. Why does ipady not leave space above and below the ...
1
vote
2
answers
2k
views
Cant figure out how to stop columns and rows from shifting in TkInter GUI
So, I am working on a final project for my Python class and am creating a GUI for a game using TkInter. I have a little 'sprite' if you will that moves across the GUI using button presses. I am trying ...
0
votes
2
answers
2k
views
How to divide space equally between widgets using Grid Layout Python Tkinter
I want to divide space equally between three buttons using Grid Layout in Tkinter. And those buttons should occupy the space equally even when the window is resized horizontally.
######################...
0
votes
2
answers
342
views
Is it possible to animate frames that are layed out with the grid manager in tkinter?
I made this desktop application with tkinter and finished the main functionalities.
But now I want to make it look better and even animate the menus is possible.
The thing is the buttons and widgets ...
0
votes
1
answer
4k
views
How to get a left and right frame to fill in TKinter?
I'm trying to make a window that has two half-window frames on either side, but I can't get them to fill. I need the two frames to take up half of the width and all of the height of the window, no ...
0
votes
1
answer
2k
views
Placing multiple buttons in same column - Tkinter using grid
I am trying to create a GUI for displaying data in a way that the user can flip through pages using the page buttons on the bottom (page 1, 2, 3, etc.) The problem is currently the entire window I ...
0
votes
1
answer
23
views
How to get Tkinter Python3.x to nest grids?
I've been trying for days to figure out how to just put grids in grids of objects. I've got two frames (which I guess are widgets in Tk?) I add one to the other, but the position of its widgets don't ...
0
votes
2
answers
10k
views
How to position labels using the grid method in python tkinter?
Im trying to put a large label at the top of the window in the middle, then 3 Option menus evenly spaced out below it. I can't get the menus to span across the entire window. I'm not sure if what I'm ...
0
votes
1
answer
2k
views
Python 3.5 tkinter: resizing widgets to window
I am reading, reading and reading but still unable to find the appropriate answer to my issue. I plan to create a 'Masterwindow' in which I implement several frames (currently a Navigation Panel to ...
0
votes
1
answer
141
views
tkinter: press button to get its own grid
I am trying to create a column of buttons which when they are pressed, the grid that down a row show pop up another two buttons.
for i in tlist:
opl.append(Tk.Button(self.frame, width = 12 , text=...
0
votes
1
answer
374
views
Tkinter Grid Layout Widget not in parent
I am building a GUI in Python with Tkinter however I am having issues with the Grid layout. Am I right in assuming that if you specify a parent, that child then sits at the grid position you specify ...
0
votes
1
answer
43
views
How do I make the hidden words reveal themselves when pressing a button in tkinter?
I have created a separate class for the words that are in my memory grid and I am trying to make it so they are hidden till the user presses the button that activates the toggle_info method in my ...
0
votes
1
answer
53
views
Error when trying to position two TFrames on the Tkinter grid
When trying to position 2 TFrames on the main TFrame grid, it ends up with a gap between the two that shouldn't exist
Here is the code:
import tkinter as tk
from tkinter import ttk
class App(tk.Tk):
...
0
votes
0
answers
40
views
Python Tkinter Question: Getting It All To Fit In The Window
I'm working on a tkinter application where I have a window with several widgets placed using the grid geometry manager. I'm trying to adjust the width of the columns to make the layout more compact, ...
0
votes
1
answer
136
views
Resize tkinter treeView
How can I resize the treeView in Tkinter Python
The table might be here
enter image description here
I'm getting this
enter image description here
Here's the code
from tkinter import *
from tkinter ...
0
votes
1
answer
65
views
how can i grid the button to the side of the bottom
so what I wanna do is move the button from the middle to the side as shown in the image
i tried to grid it using button.grid(row=0, column=1) but it didnt work and the button didnt move
so how do I ...
0
votes
1
answer
248
views
Tkinter Formatting Buttons in Same Row using .grid
How can I display a row of buttons across the bottom of the screen using Tkinter? The number of buttons is a variable. Could be 2 or could be 10. The number of items being displayed is also a variable....
0
votes
1
answer
385
views
How to grid columns in tkinter?
I'm making a project using tkinter but am having some trouble with using the grid method
i'm trying to place all the pictures on the right side of the screen,but its just not working
here is the code ...
0
votes
2
answers
452
views
Trying to create a 9 x 9 sudoku grid in tkinter, but the padding (padx) for every ninth square is off. What is the problem in my code?
This is all the code so far. I have tried changing the padding values, the if statement conditions, and adding an elif condition for when both (row + 1) % 3 == 0 and (col + 1) % 3 == 0. They all ...
0
votes
0
answers
38
views
Filling Tkinter window
I'm having some trouble get my frames and widgets to fill out the tkinter window. I don't know what I have wrong here. I have been trying to mess around with columnspan sticky and width/height. I am ...
0
votes
1
answer
704
views
Python How to create a matrix of buttons and put it inside of one of my frames [duplicate]
I have this code base, I would like to change those button1,2,3,4 with a matrix of buttons and put it in my leftframe, it is that posible? I have tried many things but I can't please help
from tkinter ...
0
votes
1
answer
214
views
Tkinter widgets not resizing as expected
Sorry if it's an easy fix - I'm new to tkinter (and graphical applications in general), and on my way up the learning curve.
I have a simple window in grid layout, with a canvas and a few labels to ...
0
votes
0
answers
75
views
Can't space listBox and buttons using tkinter
I've created a new frame that will hold:
-A label
-A listbox
-A button
The frame is part of the main window.
When I run the application, the label, listbox & button are close to each other and I ...
0
votes
0
answers
85
views
Need to expand row# 3 and column# 0 but do not want row #1 and column# to expand
I am using grid geometry and my need is to expand only the canvas on maximizing of the window. The canvas is on a frame which is at row#3 and column#0.
When I do
master.grid_rowconfigure(3,weight=1)
...
0
votes
0
answers
282
views
Python Tkinter label entry Widget spacing issue
I am new to Tkinter and I'm having some issues with Tkinter label and entry widget for displaying information. I am able to get the row position correct but the column positions for my entry widget is ...
0
votes
1
answer
734
views
Listbox/text entry affecting grid layout tkinter
I'm making a setlist creator that will basically allow someone to copy a title from the library into a setlist. When I put everything in the grid, for some reason the text area and listbox are bumping ...
0
votes
1
answer
201
views
Tkinter buttons and entrybox
How can I move the buttons around the grid in the code below? Whenever I try by changing the row and column nothing happens. Also, is it possible to make the textbox bigger, so that I can put ...
-1
votes
1
answer
259
views
TkInter script vs class - Canvas behaviour [duplicate]
I'm using TkInter to write a GUI that will contain an image and a few buttons in a panel next to the image.
I started by writing a script that would allow me to visualize an image, and it works just ...
-1
votes
1
answer
417
views
Issues using grid vs pack for ttk Progressbar
I'm trying to create a progressbar class that combines the standard progress bar with a label showing the percent the bar is filled in. This value can then be updated to show percent completion. The ...
-1
votes
2
answers
213
views
Changing grid position with a button in python
I am trying to make the radio buttons change the position of the entry field (called assignment)
what i expected was for it to grid it next to the button but instead i get this error
Exception in ...