Questions tagged [tkinter-layout]
378 questions
1
vote
2 answers
How to shrink a frame in tkinter after removing contents?
Most of the topics I came across deals with how to not shrink the Frame with contents, but I'm interested in shrinking it back after the destruction of said contents. Here's an example:
import tkinter as tk
root = tk.Tk()
lbl1 = tk.Label(root,…

r.ook
- 13,466
- 2
- 22
- 39
1
vote
2 answers
How to position a text in a label randomly in Tkinter
I'm a beginner in coding also more than a beginner in Python. The teacher gave us a game project in which we have to develop a memory game that first we choose the difficulty(how many numbers there are to keep in mind) and then these numbers are…

Clay Jensen
- 13
- 3
1
vote
0 answers
How to make the Master(window) widget to 'Scroll'? ( A Tkinter Question )
First, Copy the Code and See about what I am asking ( It's just a tkinter code )
Now, my question is,
When I am printing some information of removal of the person from the database and want give the list of them with the required information on THIS…

AAYUSH SHAH
- 131
- 2
- 6
1
vote
1 answer
Attempting to nest several frames within a single frame with Tkinter. How do I accomplish this in an object oriented fashion?
My code basically does this:
Which is clearly not what I want to try. For further clarification I would like my window to look similar to this:
from tkinter import *
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
class…

bluedays
- 43
- 4
1
vote
1 answer
How to make scrollbar look better
I am coding for my Shop, but it look like I can't make a good scrollbar. Does anyone could help me, I've searched for make scrollbar, but they just use .pack(). So its seem like I need to make another Frame, but I don't want use it. Here is my…

Mr Coppier
- 9
- 3
1
vote
1 answer
Tkinter Make Grid Fit Frame Size
I am wondering if there is a way to make a grids rows and columns fit the size of the Frame that is set. So that if I create a Frame and set its size that the grid will fit the size of the Frame.
This is what I tried so far:
window = Tk()
frame =…

MatthewG
- 796
- 1
- 4
- 21
1
vote
0 answers
Tkinter Application - How to reference and retrieve Entry value within a Frame?
All, this is the first time that I post question on StackOverflow.
I am writing a Tkinter application that allows user to enter stock information, and the window looks like this upon start up.
Label1 Label2 Label3
Entry1 Entry2 Entry3
If you…

AlexZZZ
- 11
- 1
1
vote
1 answer
How to be able to select the text in a tkinter Message widget?
I have a nice design for my GUI. I would want to be able to select the text displayed in Message widgets. The only suggestions I saw are to either use an Entry widget in the read only mode, but this looks completely different than a Message widget…

Hakaishin
- 2,550
- 3
- 27
- 45
1
vote
0 answers
Have non-zero weight to all tkinter widgets
I am trying to add a non-zero weight value to all widgets created in a tkinter aplication with python 3.x. I want to make all the grids in all children frames expand with the root window.
I have this code:
# Gets the size of the roots grid
Grid_Size…

Elephant
- 446
- 1
- 7
- 19
1
vote
1 answer
Tkinter pack layout: Elastic band analogy
Using pack has been described to me as like putting all of your widgets within an elastic band, the implications of this being that pack will try and keep your widgets in a small, neat area.
How close is this analogy to the truth, and what are it's…

strava
- 765
- 6
- 14
1
vote
1 answer
Tkinter/ttk - treeview does not take up the full frame
I'm trying out my first application in Tkinter/ttk. I'm running into a minor formatting problem that I am unable to resolve. I'm creating a tree view of a list of stock symbols in a frame. When I run the application only the first 10 symbols are…

jmq
- 1,559
- 9
- 21
1
vote
1 answer
listbox resizes when label added: tkinter
I'm making a GUI using .grid() because it has lot of buttons. I've put those in an interactive Frame at the top of the screen (frameone) and I have frametwo at the bottom where I want to print out messages based on what buttons a user presses. It's…

McKay L
- 25
- 7
1
vote
1 answer
Tkinter Python 3 create_rectangle parameters - relheight,relwidth,relx,rely
I've made an UI and I've used relheight,relwidth,relx,rely as the parameters for all my labels such as:
panel = Label(window, image=img,bg="#e8f3ff")
panel.image = img
panel.place(relheight=.15,relwidth=0.0425,relx=0.785,rely=0.51)
But for…

Krishnakumar M
- 109
- 1
- 5
- 12
1
vote
1 answer
Object oriented Tkinter, best way to communicate between widgets in gui with many frames
I am trying to figure out what the best way to communicate between different widgets is, where the widgets are custom classes inheriting from tkinter widgets and I have several frames present (to help with layout management). Consider for example…

Jonathan Lindgren
- 1,192
- 3
- 14
- 31
1
vote
0 answers
Entery Text function
i was wondering whether the entery text from within tkinter can take more than one function? if not is there any other way of doing it?
Here is my code:
self.UI_lbl = tk.Label(self, text="Choose Piece: ")
self.UI_lbl.grid(row=1,…

HAHAHAHAHA
- 25
- 6