Skip to content
Advertisement

Tag: tkinter

Python equivalent for C#’s generic List

I am creating a simple GUI program to manage priorities. I have successfully managed to add functionality to add an item to the listbox. Now I want to add the item to the something what is known as List<> in C#. Does such a thing exist in Python? For instance, in C#, to add an item to the listview I

Border colours of canvases (tkinter)

I need help with changing the border colour of a canvas in tkinter This is my code: I have tried: Answer You can use highlightbackground option to change color of border highlight ring(which is also a border-like thing, but is separate from the actual border). (correction, thanks to Bryan Oakley’s comment ) To change border highlight ring thickness, you should

How do we dynamically change the text in label widget of Tkinter according to the change of subscribed topic message?

I wanted to change the text of my label according to the topic message to which my node subscribes. But the problem is that the text in the label is not changing with the change of topic message. A portion of my code is given below:(I used the code to dynamically change the text in the label from https://bytes.com/topic/python/answers/629499-dynamically-displaying-time-using-tkinter-label) Answer

How to set a tkinter window to a constant size

I’m programming a little game with tkinter and briefly, I’m stuck. I have a kind od starting menu, in which are two buttons and one label. If I just create the frame everything is fine, it has the size 500×500 pixels I want the background not to change when I create the buttons and the labe, but it adapts the

Tkinter import filedialog error

I’m trying to use tkinter with python3 to open an image, see here a piece of code : I have installed python3-tk, and I have the demo window when I write in the terminal. I tried several combinations that did not work : gives , gives I tried with _tinker , FileDialog, file_dialog, but I always have “ImportError : cannot

Tkinter: getting coordinates of a mouse drawn rectangle

Working on the answer of my previous question, I wonder how to get the coordinates of the 4 pixels representing the corners of the rectangle as well as its 2 dimensions ? Answer You can use canvas.bbox(item) to get the coordinates of the bounding box of an item on the canvas. Because your item is a rectangle, the bounding box

Advertisement