408 questions
0
votes
1
answer
37
views
How do I get Tkinter to place the window in the same place on my screen?
The following code will place the window in a random position. I want it to use the fixed position I specified.
My screen is a TV with a 3840x2160 HDMI connection and a second screen 1920x1080. ...
1
vote
1
answer
78
views
Can label or button act as parent in tkinter?
I always thought that only frame and other container elements can be parent, but recently when I tried the below code, it seemed to work perfectly without any error.
import os
import tkinter as tk
...
1
vote
0
answers
47
views
Why can't I change the color and text of a Tkinter GUI? [duplicate]
I want to create a class for a Tk.Button in a Tk.Frame so that the button can have a border color independent of its background color.
I wrote this code
import tkinter as tk
class FramedButton(tk....
0
votes
1
answer
53
views
How to replace pack() with grid()
The following code enables the status bar to remain at the bottom of the window and expand to fill the window when the window is resized. How can I replace pack() with grid() to do the same thing?
...
-4
votes
1
answer
81
views
Spacing between widgets in tkinter
I wanted the button and password input to be right next to each other without a gap, but I ran into this problem and there was a gap between them. I tried to remove the space between this input and ...
0
votes
2
answers
97
views
how can i add entry boxes and other widgets to the window from outside of the function (tkinter)
I have a main window and made a pop-up window 'logwind' inside of the function 'log_window'. I want to add entry boxes to the window from outside the function but I keep getting a Name error. How can ...
0
votes
0
answers
92
views
Tkinter Grid stacking after 900+ elements
I am trying to create an expandable list viewer in python3.6.8 using tkinter grid.
I have a scroll frame that contains a list of element frames in a grid layout:
ApplicationWorkingProperlyIMG
This ...
0
votes
1
answer
73
views
tKinter: Different window size when using class
I have a app which uses ttkbootstrap and as a learning exercise wanted to turn it into a class based app. I am falling at the first hurdle so to speak as the basic window shows up as a different size....
0
votes
1
answer
61
views
Updating Tkinter widget after function
I am trying to update the widget frame when I add a new folder to the users directory, but I am unsure how to implement that function. This is what I have so far..
How I add the current directory ...
1
vote
0
answers
60
views
Children not indenting using Tkinter Treeview
I cant seem to figure out why the children of my tree are not indenting from their parent node and are lined up directly with them instead.
# Tree view initializers
# Tree Cloumns
filterTree = ttk....
0
votes
1
answer
55
views
The .place() function in tkinter uses different left window anchor for text and entry and buttons?
I place my text, entry and buttons in the same way based on the image width as seen in the code. When I now make the window bigger than the image width, then the buttons start moving like they use the ...
-1
votes
1
answer
79
views
Tkinter gui widgets resized after including matlab plot function
I am trying to use a GUI for button and plot.
When I include show_graph() function inside tabss the window is resized, also widgets and text resized to smaller.
import matplotlib.pyplot as plt
from ...
2
votes
1
answer
60
views
Tkinter text widget unexpected overflow inside grid manager
Assume a simple 3row-1col grid, where 2nd widget is a label, while 1st and 3rd widgets are Text. sticky and weight settings are most certainly correct. Grid dimensions are defined and shouldn't be ...
1
vote
1
answer
105
views
match OptionMenu and Button width (and resizable images in expandable containers)
I have an OptionMenu and a Button in adjacent rows of the same column of a grid. I don't want the grid to manage the size of these widgets, because it can make the widgets much too wide. Instead, I ...
0
votes
1
answer
47
views
Why is index = 0 used in the Tkinter grid_rowconfigure and grid_columnconfigure methods in this text editor program below?
Below is the code for a text editor program. I understand that the
grid_rowconfigure() and grid_columnconfigure() methods have to do with dyanmically resizing
of Tkinter grids so that the grid ...
0
votes
0
answers
62
views
Why is my tkinter Frame expanding when expand is set to False
I want to make a frame containing a left and right button and a frame that stores some products that can be clicked on. Yet, when I add the products into the frame with expand=False, it doesn't work.
...
0
votes
1
answer
46
views
How to add StatusBar Class and Use Grid Column as Border
I am new to learning tkinter and I am trying to make a simple tkinter GUI to run EXIFTool.
problem 1) When I uncomment StatusBar I get the following error; cannot use geometry manager grid inside . ...
0
votes
2
answers
55
views
How to get asymmetric buttons in Tkinter frame
I have a Tkinter frame with 3 buttons side by side. My goal is to have the left button about 2 or 3 times wider than the others. I tried many different grid configurations but nothing works, they stay ...
0
votes
1
answer
52
views
Right-side canvas scrolls, even when mouse is on the Left-side canvas
I've been trying to make a program, with 3 layouts depending on the window's width (using Tkinter).
The issue is in the medium layout. Whenever I place my mouse onto the left canvas and use the ...
0
votes
0
answers
36
views
How to create a dropdown which contains Tkinter frames? [duplicate]
I want to create a similar UI to the Windows update UI which contains dropdowns. Each dropdown can be expanded to reveal additional tkinter frames with buttons on the right:
How can I make this UI in ...
0
votes
1
answer
63
views
Tkinter dynamic label display
I'm working on simple window and like to have clock in it. Found out how to dynamically display time in separate window:
Somehow same code placed into my project displays only label's purple ...
0
votes
1
answer
114
views
TTKBootstrap /Tkinter Text Widget Resizing my Frames
I coded a simple ttkbootstrap/tkinter application that contains 4 Frames that divides the "root" window in 4 and added a simple button and a Text widget.
Here's the code:
import ttkbootstrap ...
2
votes
1
answer
45
views
Move buttons to East with grid method
So a little stylistic thing I want to do is move some buttons to the east side of the window while having them all on the same row.
Sounds easy enough and the grid method has a sticky parameter that ...
0
votes
1
answer
73
views
Adding scroll bar destroyed the layout structure. How to fix it?
I am writing a small example with tkinter.
Here what I got (things are layouted nicely)
enter image description here
The codes for it are given below
import tkinter
from tkinter import ttk
from ...
0
votes
1
answer
38
views
Tkinter Entry on Windows right shifted even with padx set to zero
I am running Tkinter on Widows in grid layout. The program has a mix of elements with and without columnspan. The elements that span across columns look as expected. But elements (Entry and Button) ...
1
vote
1
answer
71
views
How do I destroy frames and make it appear the way it was before in tkinter?
In the code below, I'm destroying frame1 and frame2, so that the messages can make use of the extra space after destroying frame1 and frame2.
The functionality I need is:
When a message is sent, ...
1
vote
0
answers
67
views
activate() method inside Menu widget class of Tkinter
I am facing this issue where whenever I try to trigger the activate() method by clicking the command inside the Menu widget, I am not able to see the method in action because by default the Menu ...
0
votes
0
answers
22
views
AttributeError: 'finance_tracker' object has no attribute 'back_button'
I have a problem when hiding buttons in the view_transaction function.
def create_widgets(self, transaction_frame):
# Add some style
style = ttk.Style()
# pick a theme
style.theme_use(...
0
votes
1
answer
72
views
How to remove canvas widget border inside frame widget in Tkinter?
I am prototyping a chatbot UI in tkinter. However, I can't seem to find the reason why the border of my canvas widget (at least I am assuming it is the border), which is defined inside a frame widget ...
0
votes
0
answers
113
views
Tkinter error: cannot use geometry manager pack inside . which already has slaves managed by grid
I have two programs and their layout is almost similar, but one works and one gives an error. What is the difference between them.
This is my first program which works fine:
import tkinter as tk
from ...
0
votes
1
answer
142
views
How do I make the text bold and have space in between in tkinter python?
In my code, I only want to make the sender name bold. This means I only want to make "User" and "Gpt-3.5-turbo" bold. For some reason, messages sent by "User" is always ...
0
votes
1
answer
880
views
How do I stream OpenAi gpt-3.5 response and display in tkinter frame python?
I want to stream Openai gpt-3.5 response and display in a tkinter frame. The below code works fine but the problem is that each streamed chunk is displayed in a new line. I want to join these streamed ...
0
votes
2
answers
239
views
How to embed a Tkinter GUI into another Tkinter GUI?
This is my first GUI:
#GUI1
import random, Id_generator, tkinter as tk
from tkinter import ttk
#constanst
STUDENTS = 15
TEACHERS = 4
def main():
#Main Window
app = tk.TK()
app.title('...
0
votes
2
answers
96
views
how to add a new label every time I click on a button
So I made this code that calculates a student's average and I am trying to get the results to appear at the bottom of the window.
the problem is that I want a new result label to appear every time I ...
0
votes
0
answers
70
views
Dynamically scale an image within Tkinter when changing window size or to full screen?
I've made a python script for a raspberry pi that:
records audio for 4 seconds.
uses Shazam via Shazamio to find the song title and artist and cover art.
makes a window using Tkinter and shows the ...
1
vote
2
answers
92
views
How do you get tkinter dropdown menu to open on top of other windows?
I am running this in Pycharm, and I can't get this dropdown to open on top of other windows. I would also like to center the dropdown menu in the center of the screen.
from tkinter import *
def ...
0
votes
1
answer
110
views
How do I create solid walls in a tkinter window?
I am turning my board game into a simply animated python game and I was wondering how to create walls that will stop my player entity. It is a dungeon crawler style game. Perhaps it would be possible ...
-1
votes
1
answer
98
views
problem on making canvas size dynamic using tkinter
I want to make the canvas size change dynamically when the size of the size if the window changes.
my canvas is in a frame and the frame is inside the root.
as you can see in the code:
canvas = tk....
-2
votes
1
answer
73
views
I want a tkinter button in python to change its position by resizing the window
I made a desktop app using Tkinter Python and I had a problem with the positions of the button, especially the exit button, I am using "pack" as shown in the following imgs:
I've tried to ...
0
votes
1
answer
62
views
Switching between Class Frames Tkinter
Main/Parent Class
class tkinterApp(tk.Tk): #Root Window
def __init__(self):
#main set up
super().__init__()
self.geometry("700x700")
self.title('Wuiz')
...
0
votes
1
answer
529
views
'border_color' custom tkinter not working properly?
I am using border_color on a custom tkinter frame and it is not working properly. Here is a picture of how it looks:
I want the border colour to be around the whole frame but it is not doing so.
Here ...
1
vote
1
answer
125
views
What is the Standard way to Achieve this grid in Tkinter?
I'm trying to create:
I'm Trying to Create this grid layout (ignoring Entry box right now) but I'm Having issue in stretching the 5th row having 5 columns equally. So far, I have achieved this.
Code ...
0
votes
1
answer
69
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):
...
1
vote
3
answers
91
views
Tkinter vertical scrollbar doesn't work functionally, it only shows small bar
I need to add a vertical scroll bar for the "treeview_1" which is inside a grid.
Basically, I created a grid.
Inside a grid
so, my solution is at this part
# scrollbar
vsb = ttk....
0
votes
1
answer
245
views
Tkinter PhotoImage is returning 'pyimage1' instead of the actual image in treeview row
as the title suggests, im writing a program that returns data from a mongodb database and shows it in a treeview. This data includes a base64 encoded image.
When I pull back the b64 image and decode ...
0
votes
1
answer
189
views
tkinter: sync geometry() and GNOME 3
For some tkinter app wanted to save/restore windows configurations. Was using geometry() method. Getting the results I have failed to comprehend, I composed an example below to illustrate the problem.
...
0
votes
1
answer
1k
views
How do I resize placed tkinter widgets when the window is resized using .place() only?
I don't know if it's a duplicate question or not but I really want to be able to resize placed tkinter widgets when window is resized using .place() only. I know that I can use .grid() for this but to ...
0
votes
1
answer
62
views
Why does a frame not have an evenly distributed grid to the interface
I want to navigate through different pages(frames) on my TKinter interface using buttons. First I need a grid that is evenly distributed over the interface so that I can place widgets accordingly on ...
0
votes
1
answer
56
views
Tkinter Frame won't fill remaining space
I am just trying to make the green frame fill the remaining empty space of a window, but I can only get it to fill the bottom half no matter what I do.
Screenshot
Here is my code:
from tkinter import *...
1
vote
2
answers
58
views
How to get rid of spaces ? tkinter
I want to make "=" button higher so it cover the space above(also wanna make "." wider so it also covers space)
what I am getting
so I want to join the cell above "=" and ...