Questions tagged [tkinter-layout]

378 questions
0
votes
2 answers

How to place a canvas object at the bottom of the window?

So I want to place a rectangle at the bottom of my window. How do I find the right y-coordinate? My window is turned on fullscreen, so the y-coordinate isn't always the same. Since I don't know much about the math python uses and I sometimes find…
Contrean
  • 64
  • 7
0
votes
0 answers

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 messed up. I am placing the entry on the next…
0
votes
1 answer

How do I make a pygame trivia question appear in the entry widget

I'm trying to create a trivia game using pygame. The first trivia question appears on the entry widget. However, I want the second question to appear in the entry widget once the first question has been answered correctly. Also If at any point the…
Lilian
  • 25
  • 5
0
votes
1 answer

Text tag in adding 2 spaces in the begining of each line

I have a scrollbar within a text widget, so I created a text tag to insert 2 spaces at the end of each line so that one letter words don't end up behind scrollbar, I made insert lineend as index for "space_tag", but it is also adding 2 additional…
0
votes
0 answers

Tkinter, widget inside widget inside a frame

Ok, so game developing isn't knew for me, well not entirely. So, I've been getting a window open(which I already did) and this window was going to display different frames when I need it to. The code below opens the window and opens the…
0
votes
1 answer

How do I add a picture background on tkinter on a toplevel window?

I found this code for a picture background which worked great on my main window: C = Canvas(window, bg="blue", height=250, width=300) filename = PhotoImage(file = "C:\\file_address\\background.png") background_label = Label(window,…
Holly
  • 65
  • 10
0
votes
2 answers

How to align widgets in a grid with tkinter?

I am trying to align a label in the center of the window with two buttons under it, also centered. I have been googling and looking on here to figure out how to do it and I have found grid to be helpful but it is not doing what I expect. It works as…
Jordan Ward
  • 29
  • 1
  • 7
0
votes
1 answer

How do you get a Tkinter widget to size with canvas display window?

import tkinter as tk import tkinter.ttk as ttk root=tk.Tk() canvas = tk.Canvas(root, width=300, height=300, borderwidth=0, highlightthickness=0, bg="#000040") canvas.pack(fill=tk.BOTH,…
0
votes
1 answer

How to add a CV2 tracking bar in a tkinter window

How to add a cv2 trackbar to a Tkinter window? I have 2 snippets of code that my teammates have made, but it is difficult to integrate them in the same window. I am able to use them in separate windows but I want to use them in the same window.…
Ayush Pant
  • 31
  • 1
  • 6
0
votes
0 answers

How can I get information from entry and inserted that in another entry I want that work vice versa?

I am making a converter. You should be able to write some numbers in the first entry and other converts, and you should be able to do that vice versa. from tkinter import* def on_entry_click(event): global c c=1 print(c) def…
0
votes
1 answer

opening a new gui from the gui

updated code as per below comments I'm struggling to get my top level to open on button press! I've scanned the code on here but don't seem to be able to get a woking solution. My latest error is: AttributeError: '_tkinter.tkapp' object has no…
0
votes
1 answer

tkinter Frame grids are not adjusting as per grid config

.gridcolumnconfig has no effect on output: I am trying to understand the grid config in tkinter. In the below sample code, the output has no effect for whatever weight I am giving in .gridcolumnconfig. Please help me understand how .gridcolumnconfig…
LOKE2707
  • 312
  • 1
  • 5
  • 19
0
votes
1 answer

Setting a scrollbar to work with a treeview

I'm attempting to add a scrollbar to a tree here in order to keep the data within view for the user, as the tree stretches offscreen(the window is limited at 1280x720). However, the scrollbar does not move it across. Here is the code: self.treeFrame…
0
votes
0 answers

How to stack two windows on top of each other in tkinter

I am trying to design a GUI that hold a map the user can interact with (move around, zoom in and zoom out from, etc.) and some additional bottoms with different functions attached to them. The way i want it to work is to have a main window that…
0
votes
1 answer

Issues with Tkinter in having buttons in the secondary (second) window by click button in main window

I have now been able to generate a code which pops up a new window with entries, when I click the button "Test" in the first Window. However, I am having problems creating buttons in the second window. The entries are created, but no buttons. Also…
Stan
  • 786
  • 1
  • 9
  • 25