Category "tkinter"

Bind function to multiple labels named equally - tkinter

I want to allow the user to create as many labels as they want using the following code: def new_line(event): global Row_n Row_n = Row_n + 1 Choose=

How to create my own Python package and save it on my computer

I created a package. It's a function I need to use in almost every Tkinter project of mine. It centers my Tkinter window on the screen of the user. How do I mak

How to position several widgets side by side, on one line, with tkinter?

By default, after making a tkinter button, it automatically puts the next one on the other line. How do I stop this from happening? I want to do something like

Problem starting tkinter files using import

I'm trying to make my code smaller by using import instead of os.startfile() to open my other .pyw code. I'm having some problems with starting one of the files

Keep TopLevel window in front of main window

I created a TopLevel window that appears in front of my main window when it pops up. It works as intended when I run the program from the command line. The prob

Is there an onload event for Python's tkinter Window?

Currently learning the tkinter module for Python 3.7 Is there an Onload() event (kind of like the c#'s WPF onload event)? The background, I am trying to load

Using returned variable from 1 function in another

I have spent many hours all over the internet and this site trying to determine what is going on. All I'm trying to do is, using tkinter, have 1 button (Browse

NameError: name 'player' is not defined - but it was defined, just in another function

The below code gives an error, "NameError: name 'player' is not defined". I dont understand why. When I have the music just playing, without needing to be trigg

Tkinter in python - not found

I wanted to use tkinter in python 2.7, but it says, it is not found. Neither I can install it using pip install. How to install it ? Python 2.7.5 (default, Nov

How do I collect multiple entries into a single label using tkinter?

I'm trying to create a tkinter program that allows for dynamically adding Entry fields using a button. I have that in place but now I am trying to store the use

set text of text widget later in code

I have a text field as so: input_field = tkinter.Entry(root).pack() How would I go about setting the text of it in another area of the code? Let's say I wa

Difference Between Variable And Textvariable in tkinter

My code: my_var = tk.StringVar() m_var2 = tk.StringVar() my_entry1 = ttk.Entry(root, width=16, textvariable=my_var) my_radio1 = ttk.Radiobutton(root, text="1

Tkinter bind Mac OS "command+q"

I'm trying to "stop" the root window exiting when I press "Command+q" but it's impossible. The other key shortcuts work on my Mac OS, even in Windows/Linux, "Al

Accessing child widgets of a window by their names?

Is there any way in Python/tkinter to access child elements referring by their variable names, but from an other function? For example in VBA, it is possible t

Problem with bouncing ball ui vertical instead of horinzontal

I was just wondering how I would make this go horizontal or diagonal? right now, it is bouncing vertically would I need to change any of the variables or the po

why cant i install ImageTk

I'm getting into Tkinter and I'm trying to put images into the windows it makes, but wherever I search the internet all I find is that I need a module called Im

How to change the width of a tkk Scrollbar in a custom style?

When defining a custom style for ttk Scrollbar, I'm stuck how can I change the width of the scrollbar. I have noticed that the width (thickness) shrinks when I

Tkinter Treeview background tag not working

Trying to colorize different rows in a Tkinter Treeview. I have gone through multiple docs and tutorials and believe I am doing it correctly (even tried variati

How do I call the same function with tkinter?

I have a simple tkinter window with two radiobuttons. If I select 'Yes', a new line is added with two other radiobuttons. I try to use the same function every t

How to Divide the Contents of a TkInter Entry With a Number?

I've been trying to figure out how to divide the contents of a TkInter entry box with a number (a float, to be precise). I looked it up on Google, and I found n