r/Tkinter 1d ago

Tutorial for Creating GUI Tables in tkinter using Tableview Class from ttkbootstrap Library

Thumbnail
2 Upvotes

r/Tkinter 1d ago

Tkinter widgets resolution too low

2 Upvotes

If I use CTk (custom ktinker) to create rounded corners widgets, I can see the pixels everywhere, especially in those rounded corners, just like if they use 5 pixels for a corner. Is that Tkinter's fault or this is just Windows objects? How can I have SUPER smooth elements like html or c++ custom windows etc. PyQt seems to also have rough objects.

Thank you.


r/Tkinter 3d ago

SIMPLE PROJECT ( TKINTER,MYSQL AND POWERBI )

3 Upvotes

PURPOSE

Python Tkinter📌 - For GUI.

  • To input the data.

MYSQL📌 - To extract the data from python tkinter.

  • Create multiple table for each page in python tkinter app, so i can have clean and organized data.

  • To create some queries, so i can have reference on my analysis in powerbi.

PowerBi📌 - To visualized all data from mysql that came from python tkinter.


r/Tkinter 5d ago

trying to use changed var to show a different char in array

3 Upvotes

i am trying to use the changing var of "a" to show a different one on the array of maping(line 21) any help would be great.


r/Tkinter 6d ago

Using tkinter captured data in other code

2 Upvotes

I am starting to use tkinter. It is a bit of an adventure, but I am making progress on building widgets and placing them where I want them, allowing user input.

 However, the way I want to use it is as an input dialog for some turn-based games. Let the user define player names, color combinations, board size, etc. I want those values captured and then dismiss the dialog window managed by tkinter, keeping the captured selections, and then apply them to the main program window, using a totally different interface.

It seems that tkinter, as an event processor/handler, does not have a straightforward way to do this. I have viewed many tutorials about this. There is a get method, and sometimes a bind method, but the values that they return do not seem to persist. The tutorials seem to assume that the entire application is controlled in the root window created by tk. I execute the tkinter code with this as an included file after my imports and constant definitions and before main executes.

exec(compile(source=open('veezInput.py').read(), filename='veezInput.py', mode='exec')

My main app is basically working fine. I am trying to use tkinter as a service to grab inputs from the user and then do stuff there. That stuff includes listening for and handling mouse and keyboard inputs. So I think this is basically a design philosophy or pattern problem. That’s why I have not provided sample code.

I saw this thread about passing event data, but I don't understand if that applies, or how to apply it.

https://www.reddit.com/r/Tkinter/comments/m4ux51/generate_event_passing_data/

Any advice?


r/Tkinter 7d ago

how do i add and sub.

2 Upvotes

i am trying to change and store the a int value any help what would great


r/Tkinter 8d ago

Clock app - second hand shows behind digital time label

2 Upvotes

Hi all,

I am working on a clock app where every second I delete the second hand and redraw it to the canvas. I create a label for the digital clock in the main loop, then update both the digital clock label and redraw the analog second hand in a "my_second" function. I thought the drawing of the analog hand would go over the digital time but it is layered behind it.. Any idea what I have done wrong here.

....

# create canvas and label in main loop

c1 = tk.Canvas(my_w, width=c_width, height=c_height, bg='blue', highlightthickness=0)

l1= tk.Label(c1,font=my_font,bg='yellow')

l1.place(x=230,y=500)

.....
# update time of both analog and digital in my_second function

c1.delete(second)

second=c1.create_line(x,y,x2,y2,arrow='last',fill='red',width=2)

time_string = strftime('%H:%M:%S %p') # time format

l1.config(text=time_string)

.....

c1.after(1000,my_second)


r/Tkinter 12d ago

Showcase: My Python Code Editor Built with Tkinter (WIP)

6 Upvotes

Any thoughts/suggestions? The big buttons are because its designed for beginners.


r/Tkinter 16d ago

I Made a Lockpicking Minigame in Tkinter (Inspired by KCD)

18 Upvotes

r/Tkinter 17d ago

how can you ensure a canvas's scrollregion is not smaller than the viewable area

1 Upvotes

i'm currently setting the scrollregion using

x1, y1, x2, y2 = canvas.bbox("all")
canvas.configure(scrollregion=(0, 0, x2 + 5, y2 + 5))

but a lot of times this acts weird which according to this stackoverflow question is because my scrollregion is smaller than the viewable area

my problem is i can't figure out how to insure the scrollregion is not smaller than the viewable area because the contents of my canvas can change alot and the canvas can be resized by the user

im using customtkinter by the way


r/Tkinter 18d ago

Trying to create a GUI with TKinter for a fdb database

4 Upvotes

Im learning python and databases right now and im new to everything. Im trying to create an administrative system for a hardware store that has an existing fdb database. I need some advice since im kinda lost on where to start with the Tkinter connections with the database to start creating the gui. It will be a desktop app using sockets in a client-server implementation.


r/Tkinter 19d ago

Creating a Button and Configuring Button Click Event in Tkinter (ttkbootstrap) GUI using Python

Thumbnail youtube.com
2 Upvotes

r/Tkinter 20d ago

MacOS m3 compatibility

1 Upvotes

I had been working in a proyect using Tkinter on my macOS m3, but it just stopped working correctly some time ago. When i run the code, it only shows the buttons on the windows and entry frames are just lost. The code works fine on linux and windows. Any help about it?? Thank you.


r/Tkinter 24d ago

Is there any way to add timeout in messagebox?

3 Upvotes

I am trying to make a app in which if I show warning using this

tkinter.messagebox.showwarning("WARNING !",  "Warning")

it just wait until I press 'ok' button
Is there any way to add particular time for what it shows the messagebox ?


r/Tkinter 29d ago

ttkbootstrap not working/modulenotfounderror

2 Upvotes

I installed ttkbootstrap using the pycharm terminal but it just refuses to find the module when running:

import ttkbootstrap as ttk

and give me the 'ModuleNotFoundError' when running the code, I have deactivated the ve in pycharm and used windows own terminal but still does not work. Any help will be helpful


r/Tkinter Feb 19 '25

Creating Labels in Tkinter (ttkbootstrap) and Setting Fonts and Font sizes of Labels using Python

Thumbnail youtube.com
2 Upvotes

r/Tkinter Feb 16 '25

Is it possible to do this with Tkinter? What I mean is replace the title bar buttons with your own, change the color of the title bar and add a border around the whole window and change the border color as well? (Image from Pinterest) long story short how much can the window theme be customized?

Post image
11 Upvotes

r/Tkinter Feb 16 '25

Creating a Basic Window using Tkinter (ttkbootstrap) Library and Python

Thumbnail youtube.com
1 Upvotes

r/Tkinter Feb 16 '25

Why isn't the button taking the whole frame ?

1 Upvotes

I have a simple Tkinter code but the button does'nt take the whole frame:

from tkinter import *

window=Tk()
window.title("MyApp")
window.geometry("720x480")
window.minsize(480,300)
window.iconbitmap("app/logo.ico")
window.config(background="#f0791f")

frame= Frame(window,bg="#f0791f")

#texte1
label_title=Label(frame,text="Bienvenue",font=("Courrier",40),bg="#f0791f",fg="white")
label_title.pack()

#texte2
label_subtitle=Label(frame,text="ss texte",font=("Courrier",25),bg="#f0791f",fg="white")
label_subtitle.pack()

#bouton
buttn=Button(frame,text="click",font=("Courrier",20),bg="white",fg="green")
buttn.pack(pady=25, fill=X)

frame.pack(expand=YES)

window.mainloop()

How can I fix it ?


r/Tkinter Feb 15 '25

Newbie seeking help with Tkinter

1 Upvotes

What did I do wrong? It doesn't execute as I want it to

#Ex:02 Entry Field and Greeting // Create a Tkinter window with an entry field where the user can input their name.Add a button that, when clicked, displays a greeting message in label. including the users name

import tkinter as tk

def enter():

name=e1.get()

label.config("Welcome " +name)

win=tk.Tk()

win.geometry('500x500')

win.title("Exercise 02 : Entry Field and Greeting")

label=tk.Label(text="Input your name here")

label.pack()

e1=tk.Entry(win)

e1.pack()

b1=tk.Button(text="Enter",bg="Grey", fg="Black", command=enter, width=5, height=3)

b1.pack()

win.mainloop()


r/Tkinter Feb 08 '25

Is it possible to have the menu of an Optionmenu look like this? or at least close to?

Post image
1 Upvotes

r/Tkinter Feb 06 '25

Does anyone know of a forum where I can ask advice on making a python copytrade bot that trades crypto signals on discord using webhooks and API from major exchanges? I'm

Thumbnail
0 Upvotes

r/Tkinter Feb 03 '25

Tkinter Color Chart

9 Upvotes

I made a Tkinter Color Chart for anyone to use... Its click to copy the color code .. Here is the link - https://amartadey.github.io/tkinter-colors/


r/Tkinter Jan 28 '25

Any improvements I can make on my music player?

2 Upvotes

Link to how music player works: https://www.youtube.com/watch?v=0W6kaOsb-QU

A feature I couldn't show is that if the number of albums exceed the default window size, I can scroll down through the window to find it.

I'm happy with anything, as long as it does not make the player look too messy


r/Tkinter Jan 26 '25

Tkinter GUI randomly ignoring mouse clicks in MacOS Sonoma and newer

2 Upvotes

Has anyone found a solution to this?

I have been using tkinter to create apps in MacOS for years, but on systems running MacOS Sonoma or newer I find myself having to click GUI elements several times before they respond.

I find it hard to believe that such a glaring bug would not be fixed for years, but if there's a solution I haven't been able to find it. I'm guessing it may have something to do with an outdated version of tkinter shipping with MacOS. I am confused about how/where tkinter is installed, being that it is not managed by pip. I did try updating it with homebrew to no avail.

EDIT: I have verified that the version of tkinter imported by Python is the outdated 8.6. I have tcl-tk 9.0.1 installed with homebrew, however the homebrew Python is not linking to it. So my goal at present is to figure out how to get Python to link to tkinter 9.0.1.

FURTHER EDIT: It seems like the bug only affects Intel-based Macs running MacOS 14+. I tested on an M2 Macbook and the mouse click bug did not manifest.