Questions tagged [tkinter-layout]
378 questions
0
votes
1 answer
How do I place the widgets in the canvas?
I'm creating a project for my school using tkinter which focuses on a Dental Clinic. The code that I've posted here opens a window which asks the patient to login or sign up. The function is working properly except the canvas part. When the function…

Ritesh Sachan
- 19
- 6
0
votes
1 answer
pack_propagate(0) equivalent for Grid and place
I am trying to place a button on a frame for an application that am working on...
But the frame disappears when I use pack or grid
from Tkinter import *
root=Tk()
width = root.winfo_screenwidth()
height =…

Franky
- 23
- 5
0
votes
0 answers
tkinter scrollbar for dynamic layout
I have added widget after press of a button in the below code. Now I want to add scrollbar to scroll the added widgets but the scrollbar is not working. Can someone please post the working code for the same as I am unable to find the solution.
from…

Mayuresh Sardar
- 59
- 7
0
votes
1 answer
How to make a widget occupy the same width as that of its master frame when using columnspan?
Given the following grid layout configuration:
It was generated through code:
from Tkinter import *
master = Tk()
frame1 = Frame(master, width=100, height=100, bg="red")
frame1.grid(sticky="nsew", columnspan=4)
frame2 = Frame(master, width=100,…

Diogo Cosin
- 107
- 11
0
votes
1 answer
unable to use variable of one function to another function in tkinter python
I am trying to create the GUI, I am unable to use the value of a variable in one function on the other function in tkinter
But, in normal functions, when we declare the variable as global, it is accessible.
Here is my code,
from tkinter import…

Sellavel
- 1
- 1
0
votes
1 answer
Title and button placement in Tkinter
Sorry for the not-so-pretty code, but this is just a quick example of the problem I have.
I want the questions and buttons to be underneath each other, it works fine as long as the buttons are not next to each other like here:
from tkinter import…

Kukku
- 1
- 2
0
votes
1 answer
How to use radio buttons to assign a value to a variable in Python?
I am trying to assign a value to a variable using a radio button in python with the following code:
def print_me():
global payment
global membership
if studentMemString == "PY_VAR0":
membership = "STUDENT"
payment = studentMem
elif…

Cameron Hamilton
- 29
- 1
- 2
- 8
0
votes
0 answers
How do I run a tkinter application from an imported python file that I created?
Okay so I have main window (root) which is essential my main menu. It has buttons that I want to be able to be clicked and start up another window. I know I could achieve this by putting all of the code in one file but I've been told it's messy and…

Cameron Hamilton
- 29
- 1
- 2
- 8
0
votes
1 answer
How do I use tkinter 'Treeview' to list items in a table of a database?
I have a SQLite database that I am going to read from and list one of its tables data into a tree view. I have been searching for a long time in order to get this to work and I am struggling to find anything that either works or makes sense to me.…

Cameron Hamilton
- 29
- 1
- 2
- 8
0
votes
3 answers
Tkinter issue with using wrap length on a Label widget organised within a grid
So I have 2 rows dedicated to a messaged label widget to display any successful/unsuccessful messages to the user while they're using the tkinter GUI.
Some of the messages are to long to fit within the column width, so I have used the wraplength…

Dani Green
- 21
- 1
- 6
0
votes
1 answer
setting inner modules in frame using tkinter
Here's my code and what exactly I'm trying to do is setting the URL label in mid of frame and the entry text next to it, and adding 3 buttons below the URL and entry text field.
import tkinter as tk
from tkinter import *
root =…

Monika Razdan
- 33
- 6
0
votes
1 answer
tkinter placement of widgets
Consider the following simple code:
from tkinter import *
mainFrame = Frame(parent, bd=5, bg="yellow").pack(expand=True,fill=BOTH)
frameA = Frame(mainFrame, bd=5, bg="green").place(anchor=NW, relx=0, rely=0 , relwidth=1.0, height=40)
…

epeleg
- 10,347
- 17
- 101
- 151
-1
votes
0 answers
Python, tkinter grid: Prevent row from growing
I am pretty familiar with python, however right now I am creating my first program with user interface using tkinter.
I have a grid layout in my scenario in column 3, row 1 (it is the second row and fourth column I am including row/column 0 here) is…

BB23
- 173
- 9
-1
votes
1 answer
Why is there an error when i am trying to output a PNG image to a tkinter GUI?
The code is giving me and error saying that there is no image.
Any suggestions helpful
It is saying that the image1 is not an image, which as you can see is not true as it is created when the code is run.
import pandas as pd
import numpy as…

Jerseytbw
- 1
- 1
-1
votes
1 answer
Tkinter nested frames + grid manager overlapping and uneven spacing
When trying to create nested frames with grid layouts I get overlapping and uneven spacing.
The expected results is the TitleFrame is above the Boardframe and the squares on the BoardFrame are evenly spaced. (quick mockup done here in paint)
The…

Adrian Edelen
- 50
- 9