PySide Button Auto Repeat doesn't start until mouse is moved - python

I have a PySide application with a single button that implements auto-repeat. But the auto-repeat functionality doesn't seem to be working correctly.
If I simply click and hold the button, its function is only called once no matter how long I wait or what the auto-repeat settings are. But as soon as I move the mouse, the button's functionality is called repeatedly, just as it should be.
This is with Python 2.6, PySide 1.1.2, running on Windows 7 64 bit.
self.btn.setAutoRepeat(True)
self.btn.setAutoRepeatDelay(200)
self.btn.setAutoRepeatInterval(100)

I was having a similar problem using normal QT4.x on linux. The issue was that something was connected to the clicked signal. I think it was stealing/changing the focus of the mouse. I just changed that item to connect to the the released signal. That doesn't mean you can't connect to clicked, but just be sure that there are no focus stealing side-effects.

Related

WxPython exit button doesn´t always works

I am using a code designed by another person in MAC OS. I am using Windows instead and have slightly modified it, but the problem comes when using the GUI that is created.
I have already dealt with a similar issue with a slider. Once I pressed the slider, I couldn´t release it or press another button. I was forced to quit the GUI and start again. I solved it by changing the event command from EVT_COMMAND_SCROLL to EVT_COMMAND_SCROLL_THUMBTRACK. However I did not understand why it worked in MAC OS and does not work in Windows.
Now, I want to close the GUI with the typical cross inside the red button in the right corner of the window. I can do it if it is the first order I do in the GUI. If I first press any button or slider, the exit button does not work.
It made me consider if a major problem is hidden in the code which I am not seeing. I am new at wxPython, which is the module used in the code.
I just ask for your opinion and hope it is a basic error.
Thanks very much

How to make a clickable control that is always on top, in Windows using Python?

The goal is to have an application that runs on top of all other applications and windows in the desktop, and display a clickable control (say, an image button) that moves around the screen.
The application must run as a service in the background and show thebutton (let's say) each hour, once clicked it disappears until the next hour.
This application has to be written in Python.
It looks like PyQt is one of the better options, but I'm not sure if it does support this sort of functionality and if it is a good alternative for modern Windows applications.
What packages or frameworks are appropriate for this scenario? I have seen Pygl and PyGame but they seem to be limited to a window, is this correct?
You actually don't need to create the program as a service. You can just start the application and not show the window immediately. You can use PyQt or wxPython. I'm more familiar with wxPython, so if you went that route, you could use a wx.Frame style flag such as wx.STAY_ON_TOP to get the functionality you want.
I have created applications that load up in the system tray with just an icon. When you click the icon, it shows the frame. The rest of the time, the frame is hidden. I would try that route before looking at doing a service.

easygui CLOSE button (on top right of window) not functioning

i have created a chat system in python, using easygui for graphical user interface.
there are minimize,maximize and close button on top right of window,but the close button is not functioning at all.i just can use the exit button which i created to close the application. i had some search and found there is a problem with easygui, so is it totally impossible to fix this problem? or how can i remove that close button from top right as there is no use for it. its final year project and i'm afraid my advisor and supervisor want try that button and i lose mark because of no function
is there anyway to fix it or at least remove that close button?
This is likely past the due date for your assignment...sorry. But, that was a known limitation of easygui. An up-to-date version with a fix for that will be released soon. If you can't wait, you can take a look at it in development form: https://github.com/robertlugg/easygui

Python win32api mouse control losing focus

I'm using win32api in a Python script to control mouse movements. It's working fantastic, but as soon as I click (I also generate click events) outside my Python shell/IDE, all my mouse events immediately stop. If I click my shell/IDE again, control is restored.
It seems like mouse control is only working when my Python shell or IDE is the "active" window - is there any way to retain mouse control even after Python is sent to the background?
Turns out this was not a Python issue, but was an issue with the device I was using to generate mouse movements. A separate API call was required to allow this device to push events when its owner was out of focus.

Mouse left click doesn't fire wx.EVT_BUTTON in Linux. Works in Windows

I'm trying to port my wxpython GUI to Linux from Windows and it's not behaving the same. Specifically, a mouse left click is not firing the wx.EVT_BUTTON event. When I left click it only appears to select the control. If I click spacebar it animates the button and the event is triggered.
This is my first time using wxpython in Linux, so I created a test UI frame with a wx.Button. In this case, the behavior works as expected. My bindings and events are the same in both applications, so I'm not quite sure what's up. The only difference is my original application has a parent wx.Frame with multiple children of type wx.Panel, whereas my test application is a solitary wx.Frame.

Categories

Resources