Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
85 views

Why do I need a empty window.attributes() to create a transparent window using tkinter (in python)?

When I create a transparent window with tkinter in python I need to start with a empty window.attributes() call.Otherwise it doesn't become transparent. Is this a bug or wanted behavior ? Example code:...
Garo's user avatar
  • 1,480
0 votes
2 answers
77 views

The button goes under the search frame, Tkinter

I trying to do a search frame, but when I added the button, It goes under the frame of the search, appears, and then disappears fast. In the search entry, when I run the code, it appears, and when I ...
mohammed's user avatar
1 vote
1 answer
55 views

Remove internal border inside a Text widget

Is it possible to remove the border around between the tkinter.Text widget and the background colour of a tag inside it? I set both the border width and highlightthickness to 0 but the border is still ...
TheLizzard's user avatar
  • 7,670
0 votes
0 answers
37 views

Building a class to apply styling and behavior to targeted tkinter widgets and can't get them to behave together

I wanted a button with a bit more on it's face, a fancy button, and ended up building a FancyButton class that will wrap a "surface" defined by tkinter widgets in a series of frames and ...
Thomas Miller's user avatar
0 votes
1 answer
124 views

ttkthemes doesn't theme entire window when applied to root

None of the themes I've tried in ttkthemes will theme the entire window. I apply the theme to the root/self and it will only theme text/buttons Screenshots: I was expecting the window to fill the ...
youChoose10's user avatar
1 vote
1 answer
74 views

How to add anonymous Checkboxes (or anything else) in ctkinter?

So recently I was creating an app that you can add Checkboxes to, and they were your works to do (to do list app), so I wanted to manage the Checkboxes that were added, and because they don't have ...
taha farzaneh's user avatar
-1 votes
1 answer
78 views

Why can't I make my app's screen responsive even by increasing ´self.geometry("1000x700")´?

Here's an image of the app: I'm trying to make all the options visible, however even increasing the dimensions the screen doesn't enlarge and doesn't solve the problem class App(tk.Tk): def ...
Jonh Alex's user avatar
1 vote
2 answers
67 views

Cannot remove widget after activating checkbox in Python Tkinter

I am working on my pet-project. Under the working on GUI part, I faced a problem. I want to add a new widget after clicking the checkbox the first time, and on the second click, this widget should be ...
vldrud's user avatar
  • 33
1 vote
1 answer
148 views

tkinter and Scaling Factors on Linux

I am developing a cross-platform GUI using tkinter (for pydiode). I want the GUI to scale properly on 4K screens. Currently, it works well on macOS, but I'm having difficulty on Linux (Debian). The ...
Peter Story's user avatar
1 vote
0 answers
117 views

On Windws, Windows Subsystem for Linux (WSL) and every time I install Python, I get ModuleNotFoundError: No module named '_tkinter'

On Ubuntu 24.04, Here is the Error I get: [I] /home/sporty~> pyenv install 3.12.2 Downloading Python-3.12.2.tar.xz... -> https://www.python.org/ftp/python/3.12.2/Python-3.12.2.tar.xz ...
user1135541's user avatar
  • 1,891
0 votes
0 answers
65 views

How can I make the background of this Python/Tk Treeview table all dark?

I'm preparing to write a user interface for a REST interface and I've never used Python/Tk before. I've written a program which shows files in the current folder for now while I figure out the look ...
Benj's user avatar
  • 32.3k
2 votes
0 answers
69 views

Tkinter event loop can't process some key combinations when use <KeyPress> event

Here is the code from another question, which demonstrates the problem very well (I just found it when I was looking for solution for my problem). So, when you press some specific key combination, the ...
Mika's user avatar
  • 179
0 votes
1 answer
51 views

I want to update a Frame/push a variable of an image to a existing Frame but it doesn't update

import cv2 as cv import tkinter as tk from tkinter import ttk from MakeImageList import * from PIL import Image,ImageTk class mainFrameClass(tk.Tk): def __init__(self,*args, **kwargs) : ...
Captn03's user avatar
-1 votes
1 answer
30 views

How do I calculate the rectangles of the window decoration / taskbar / titlebar in tkinter

Many questions on this site asking about the height of the titlebar or the taskbar in tkinter. Often is the answer simply no or there are platform specific calls to the window-manager. So this ...
Thingamabobs's user avatar
  • 7,999
0 votes
1 answer
227 views

how can i work with grids and layouts in tkinter and ctk

so i was learning the ctk module and reached a dead end i searched so much for this and i didnt get a awnser heres my question: how can i stick the search button to the entry and make other things ...
taha farzaneh's user avatar
2 votes
0 answers
81 views

Get length of line on tkinter.canvas in inches (Mac OS)

I'm currently running Mac OS Sonoma 14.2.1 and I'm trying to set up a tkinter canvas which is scaled to "actual" real-life size. I.e., if I draw a line between any two points on the canvas, ...
JRiggles's user avatar
  • 6,623
0 votes
1 answer
50 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') ...
user14232195's user avatar
0 votes
0 answers
33 views

tkinter module not found [duplicate]

So Im about to run Kohya_ss, when I run it, I get this error ModuleNotFoundError: No module named 'tkinter'. I tried pip install tk and it says that this demand is already satisfied. I did some ...
xzeed's user avatar
  • 45
1 vote
2 answers
241 views

Python, tkinter: How do I snap the mouse pointer to the center of a window?

I need to create a window in Python, the best way by far is tkinter so I went with that. Mouse looking is going to be used: I need to make it so my mouse cursor is always snapped to the center of this ...
MirceaKitsune's user avatar
0 votes
1 answer
191 views

tkinter and buildroot on raspberry pi

I've been working on making an image via buildroot for an raspberry pi (specifically, a CM4) and have hit a bit of a roadblock with python and tkinter. The base issue is that I've tried including ...
jungle_jim's user avatar
0 votes
1 answer
96 views

Tkinter Line Numbers library not showing numbers properly

I'm building a program, but my tkinter Line Numbers library is not working. This is my code: import tkinter as tk import ctypes from tklinenums import TkLineNumbers ctypes.windll.shcore....
Muhammad Hamza Naveed's user avatar
0 votes
0 answers
52 views

Updating separate Tkinter canvases with different images simultaneously

I'm working on a Tkinter application that involves displaying real-time video feed on multiple canvases. Each canvas should display a different image received from different sources. However, I'm ...
Mostafa Saad's user avatar
0 votes
1 answer
168 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. ...
Vladimir Zolotykh's user avatar
1 vote
1 answer
77 views

tk.Tk window goes behind my Windows taskbar so there's some part of it which I cannot see

I have a window of type tk.Tk which I start up as 'zoomed'. import tkinter as tk import tkinter.ttk as ttk ... master = tk.Tk() master.state('zoomed') I work on a Windows laptop. But I noticed ...
peter.petrov's user avatar
  • 39.4k
8 votes
2 answers
4k views

tkinter extension was not compiled and GUI subsystem has been detected. Missing the Tk toolkit?

I am trying to install (through pyenv) Python-3.11.4 under CentOS-7. It installs but without GUI. I get the following error message: Installing Python-3.11.4... Traceback (most recent call last): ...
S.V's user avatar
  • 2,715
0 votes
1 answer
1k views

How to get screen dimensions on python (tkinter)

I'm working on a project and need to get the dimensions of my screen (I'm working on windows). I'm only amateur on python and work with it for fun and university works. Here is my first code with ...
Moh's user avatar
  • 1
1 vote
0 answers
74 views

tkinter background color will not change on Mac M1

I haven't a clue why not but this won't change the background color import tkinter as tk class Application: def __init__(self): self.root = tk.Tk() self.root.title("Swiperino ...
Trevor's user avatar
  • 2,447
2 votes
1 answer
425 views

How to create OOP based MenuBar with Tkinter

How to create OOP based MenuBar with Tkinter I am trying to make a GUI program using Tkinter which requires a lot of functions to be accessed from the menubar. but i cant find a way to pack those ...
christo332's user avatar
0 votes
2 answers
61 views

I can't access variables from one class in another one - Python

I'm learning OOP and am making a calculator. I have classes for the main program (the parent program), buttons, and entries. Main program: class Program(tk.Tk): def __init__(self, title, size): ...
user avatar
2 votes
1 answer
280 views

What is causing my canvas to cut off displayed images in the scrollable grid?

I have a simple Python GUI program.. It loads images from a folder and shows them in a scrollable grid. The problem I have is that it cuts off at some point. Images are still there (I can select them ...
Kryptopia's user avatar
3 votes
3 answers
630 views

What does double buffering mean in Tkinter?

I think I saw something like this on the internet: Tkinter uses double buffering to avoid flicker. What does this mean and how and where?
Module_art's user avatar
  • 1,067
-2 votes
1 answer
106 views

Not able to modify and configure instance variables from within my init method but still in same class. Python Tkinter

I am writing a quick program for a class project. I am fairly new to tkinter and most problems I have been able to find answers for. However, now I am stuck. I want to disable buttons on my widget ...
Absolem TheGreat's user avatar
-2 votes
1 answer
156 views

How can I update text by linking a Button and a ComboBox in Tkinter?

I need to link 4 buttons to a Label that has default text in it, and need to update the text in the Label based on the selected option in the combo box I have set up. I've tried to create functions to ...
Gutz3's user avatar
  • 1
0 votes
2 answers
54 views

Problem with packing widget in another window

I have a problem, I need to on button clicking pack terminal from tkterminal library in new window and destroy it(like toggle), but terminal is packing in already exists "root" window, so ...
shakebeast's user avatar
0 votes
2 answers
165 views

Implementing Tcl bgerror in python

This is a follow up question from this one where it is suggested to implement the bgerror to actually get a response to what went wrong in the background. However I'm a bit confused, as I understand ...
Thingamabobs's user avatar
  • 7,999
1 vote
0 answers
61 views

TK to run django server on windows

I have windows server running Django as a CMD process. Some PC USERS mistakenly closing it. I want to switch to TK running the Django server and put output on screen. How safe is that ? How do I close ...
Si si's user avatar
  • 346
2 votes
1 answer
94 views

Event dependent change of precedence between conflicting default and user-defined bindings in Tkinter

I have a Python GUI with Tkinter. In a class, I have some Text widgets. These have some default bindings some of which I'd like to replace preferably with bind_class(). I managed to do it with all, ...
Babber's user avatar
  • 23
-1 votes
1 answer
198 views

How can i run a SplashScreen with Threading using Tkinter?

I have a main interface with widgets.. it doesn't matter what's on the GUI. What I m trying to do is to create a splashscreen when the app is launched. The whole point is that while the interface is ...
Timothee's user avatar
0 votes
1 answer
840 views

Adding a Logo image on top left of tkinter window along with the title in same line

I have this logo below and I have to add it in the tkinter window, the logo shall be aligned to top left of window but in same line as the title label. def __init__(self, root): self.root = ...
Param Dhingana's user avatar
0 votes
1 answer
388 views

Updating Combo boxes based on user input

To provide an overview of the program, I am developing a simple retail management system. The main window of the program serves as the central hub, containing various widgets such as comboboxes, ...
user avatar
0 votes
1 answer
977 views

Combobox not displaying (Tkinter)

Im trying to use a combobox in my program. To simplify my program, my main window uses an image as a background, and my buttons and entry boxes I wont include since they arent relavent. The code for ...
user avatar
3 votes
1 answer
96 views

How do I use bindtags with ttk.Entry?

Following this question, I can setup bindtags to get events that include the keypress that activated the event. When I change tk.Entry to ttk.Entry, the events still work but I am unable to select the ...
sambler's user avatar
  • 7,067
0 votes
1 answer
541 views

Python3.11.2 Error Installing tkfontawesome "python -m pip install tkfontawesome"

I'm trying to use Font Awesome for python but I haven't been able to get it to work. import tkinter as tk from tkfontawesome import icon_to_image root = tk.Tk() fb = icon_to_image("facebook&...
msdirecti0n's user avatar
1 vote
1 answer
243 views

CTRL KeyPress event is fired trough scrolling with TouchPad

I'm trying to track the control-key when it's pressed and released. While everything seemed fine in the beginning, but when scrolling with my touch-pad on my HP laptop on Windows 11 the KeyPress event ...
Thingamabobs's user avatar
  • 7,999
2 votes
1 answer
128 views

tkinter - Infinite Canvas "world" / "view" - keeping track of items in view

I feel like this is a little bit complicated or at least I'm confused on it, so I'll try to explain it by rendering the issue. Let me know if the issue isn't clear. I get the output from my ...
Thingamabobs's user avatar
  • 7,999
0 votes
0 answers
1k views

X Error of failed request: BadAlloc (insufficient resources for operation) while running tkinter

I encountered the following error message while running a python script that I am working on. It occurred while tkinter was loading ~1800 thumbnail images, each being 200x200 pixels large, into ...
Sun Bear's user avatar
  • 8,194
2 votes
1 answer
568 views

How to change the colour of a ttk.Checkbutton when it is !disabled and selected?

How to change the colour of the indicator of ttk.Checkbutton when it is !disabled and selected? The following picture shows it is blueish in colour. Typing the following: import tkinter as tk import ...
Sun Bear's user avatar
  • 8,194
1 vote
1 answer
440 views

Python Tkinter: How to use update() thread safe instead of using mainloop()?

For context why I want to use update() and update_idletask() instead of just using mainloop(): I need to display a cv2.imshow fullscreen FullHD 50 FPS stream, grabbed in a different thread from a ...
Alex-Schaefer's user avatar
3 votes
1 answer
1k views

Tkinter - Scroll with touchpad / mouse gestures / two fingers scrolling in tkinter?

I wanted to implement two finger scrolling in tkinter. Here is the result of my own attempt: import tkinter as tk class Scene: def __init__(self, canvas): self.canvas = canvas ...
Nordine Lotfi's user avatar
0 votes
0 answers
121 views

How to show a messagebox after updating the frame?

The mainframe contains a label whose text element corresponds to a counter variable. To increase the counter, the user can press the increment button. After 10 increments, I want to show a messagebox ...
Timo's user avatar
  • 51

1
2 3 4 5
24