I have a tool to capture screenshots but this tool only captures screenshots when you hold button-1 and move to the right side, when you hold button-1 and move it to the left side or up, it does not capture the screenshot, what is the reason and how can I fix it? I thought about it, but I think it’s
Tag: tkinter
Tkinter – How to create a custom Tkinter Frame object? I tried but it doesn’t work
I tried to create some custom tkinter objects to build my GUIs easier but unfortunately I couldn’t. For example, what about if I want an object that identify a frame placed inside another one? To do that I wrote it: Main code (file name: test.py): Library (file name: ttk_plus.py): If I run test.py, the software start without any kind of
tkinter – How can I place this button on the bottom in the middle?
I would like to place the button boutonexcel at the bottom of the window, in the middle (below both frames). I tried many combination of side=… and anchor=… without success. How could I place it as I wish? Answer In this specific case, if you call pack on the button before any other widgets, and you set the side to
Tkinter : How to add multiple columns in a treeview and avoid typeError
I am trying to create a Treeview with a lot of columns. Here is my class that create the window with the treeview : I have this error when I run it : TypeError: can only concatenate str (not “tuple”) to str I know that there is a problem with my type, and the error say that this error happen
How to bind Tcl callbacks in Python
I was reading about msgcat. Quote from the docs: ::msgcat::mcunknown locale src-string ?arg arg …? This routine is called by ::msgcat::mc in the case when a translation for src-string is not defined in the current locale. The default action is to return src-string passed by format if there are any arguments. This procedure can be redefined by the application, for
How to code a menu bar across your Pygame project
I have been struggling with merging my code. I am creating an arcade game on Python and have a main file where I have an image and clickable assets which link to a game I have imported. Now I am working on creating constant features in the game, including a menu bar which displays reminders, can change the volume and
Tkinter App – TypeError: can only concatenate str (not “StringVar”) to str
I am trying to build a weather app in tkinter for class and I am stuck! I keep getting the following error message in the console: Error Message from Visual Studio Code Here’s my Python code: So, the API I used is supposed to accept the zip code which is what I am collecting using: I’m not sure how else
How do you format text from a file when reading the file into a text box in tkinter?
I’m creating an Inventory project in python using tkinter and one of the things I want it to do is display the entire inventory that is stored in a text file. So far I have it working but the format of the text after its read onto the frame is not aligned and doesn’t look great. Answer Normally I would
ttk:Combobox foreground color change doesn’t work properly. What’s wrong?
Attemps to reliably change the text color in a ttk::Combobox fail. It happens for me on Windows 10 with the native theme. The following code creates two comboboxes with their foreground color set to red. Selecting an option in one of them then the other, back and forth, shows that the foreground color alternates between black and red. Here’s what
How to generate “n” rows of Entry boxes from another Entry box?
I want to get an integer from an entry field and create new entry boxes below that. I have written a code to do that using a button. However, I want to make it happen automatically without a button as I entered the number, the rows update. I saw one way to automate it is using the callback. So, I