I have some labels which I want to make them blink in some cases, and stop blinking with specific color for their styleSheet on other cases. I have seen this useful answer, and adapted this part from the answer: I have created some labels on my main window with specific geometry and etc like: My Question is: …
Tag: user-interface
Passing a function to a Worker (QObject) class in Python GUI application to prevent freezing/blocking
I am trying to find a way to successfully pass a function to a Worker class in Python using PyQT5. Instead of using the pre-defined run function (or Long-running task) in the sample Worker class code, I would like to be able to pass a custom function to the worker class. Below I’ve pasted the sample cod…
How to add background image in Tkinter using OOP concept?
I am new to object oriented python programming. Currently I am using Python 3. I want to create an app which has multiple pages. I am able to navigate between pages but find it difficult to add image in the background. Please note I don’t want to know how to background image in tkinter as I am already a…
Python tkinter after method not working as expected
I’m trying to learn Tkinter module, but I can’t undestand why the after method doesn’t behave as expected. From what I know, it should wait ms milliseconds and then execute the function, but in my case the function gets executed many more time, not considering the time I write. Here’s …
Creating a timer with tkinter
I am creating a GUI that needs to have timer starting from 0 and counting up every second until it reaches a limit This is the code I have right now Right now this is increasing the score each second but it does not open the GUI until the score reaches the limit. How can I make it so the
How to make tkinter’s GUI components dynamic?
I am making a tkinter application for Windows, and I want to make the widget placements dynamic. Like in this picture, the Label (which is acting like a background image holder), is covering the Y-axis, but when I maximize the window, like here, the photo does not cover the whole Y-axis. How to fix this, or i…
Tkinter window menu root issue
So i’m creating a chat bot inside of a tkinter gui but keep getting an error message when creating the main menu and sub menu. Any help is appreciated. Here’s the code: The error I’m getting is: main_menu=Menu(root) NameError:’Menu’ is not defined Answer Your import is import tki…
Toggle tkinter window visibility
I’m trying to toggle tkinter window visibility when I click p. Answer Not sure what keyboard is though I am using it is the keyboard library. Anyway you can use tkinter itself for this. Here is an example to set you up: Also keep a note that wm_attributes() and attributes() are the same.
How do i resize a widget in WxPython using GridSizer
Introduction and Issue I’ve made a gridsizer to resize my frame itself. But because of the gridsizer if I use WX_EXPAND flag (to let them have a new height and width when I use self.Layout() to refresh when the app is resized) they don’t resize the % of the screen I gave them (I put blank widget t…
How do I access the value from a QLineEdit?
How do I get and store the value that is written in a QLineEdit as well as close the widget after I click save? I have looked over the PyQt5 documentation and it says the function .text() will give access to the values in a QLineEdit but for some reason the value I keep getting is the default empty string.