-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimeCtrl is currently broken and unusable #2657
Comments
Your code example seems to work fine on Linux and I can't reproduce any of those problems. Possible macOS specific problems? |
That is quite possible, I haven't yet tried Windows and Linux, but it is definitely an issue on macOS. |
I can confirm that this only affects macOS. |
Can you find a C++ stacktrace in macOS somewhere? |
Hopefully this is what you are looking for: Crash report
|
Just to add more information.
In general, there seem to be some issues when it comes to field navigation on macOS, whether it is what is specifically causing the crashes I am uncertain of. Additionally, some of the keybindings don't seem to be working on macOS either (like up and down binding to spin buttons). |
I tried running your code on my Intel MacBook Pro which has Python 3.12.6, wxPython 4.2.2 and Sequoia 15.2. When the app starts the hour field of the top TimeCtrl is highlighted. If I press Tab, the highlight disappears, but the app doesn't crash. If I then click on the spin control the minutes field gets highlighted and its value changes according to whether I clicked on the up or down arrow. |
It is possible this issue is related to their M series. My Intel mac is no longer functional so I cannot test there. I did replicate this issue on Python 3.12 on the M4 architecture though and I do have another user (who reported this issue to me) who can replicate this as well. I will confirm whether they are on Intel or not. |
Yes, I think the script above does default to the first field being selected. In my actual project (not the example) this is not the case, so an initial navigation can force one of the fields to be selected, but Tab causes a crash. If this is Arm related, then it makes sense that Intel might be more functional.
At least on the M4 mac, the cursor navigation works like a normal text control and does not select the next field, either visibly or invisibly. Using the spin buttons will revert selection back to whatever field was selected prior, unless you manually modify a field, then it gains the default focus. |
The arrow keys are not working correctly on my MacBook. |
Okay, yes, all of that is how it works on my mac as well. I could overlook such things if tab worked 🙂. But since these don't function like they do in Linux or Windows and Tab and entering |
Does wx.adv.TimePickerCtrl work on your Mac? |
Possibly, but I was specifically using TimeCtrl for its consistent size and look across platforms. |
Typing values into a TimeCtrl doesn't work properly on my Linux PC. If I run your code and press the '2' key, the hours field in the top control is deleted.
|
I don't often use it that way on Linux, I do expect some inconsistencies across platforms, that is par for the course with wxPython at times, but for a long time, simple tabbing through fields and and using the spin buttons worked fine. To be honest, I've never exhaustively tested the controls on every platform. I assumed they worked as they were supposed to 🙃. I've become aware of the other failings only recently when tabbing started crashing the application. |
I should note that the code I provided is simply the example from wxPython (or at least an earlier version of it). |
I have seen other reports of problems with the masked controls, e.g. |
Well, in the meantime, I may just need to explore other options or write my own control, not ideal, but sometimes you don't have a choice. |
Looks like wx.adv.TimePickerCtrl is going to have to be my solution. It seems to be a bit more reliable as well across systems (though I still need to test on Linux). |
I did touch bases with the original reporter, and they were on an Intel Mac, so it seems it is not just ARM related. I'm not sure why some Intel Macs don't have this issue. Hopefully, all the provided info helps. |
The provided info helps, thanks. It seems there are probably several issues here - the crash seems to be a GIL management issue, probably the same crash as reported in the other ticket. Unfortunately, I don't have a Mac so I don't have an easy way to investigate this. Perhaps someone else can. |
Operating system: Mac Sequoia 15.1.1
wxPython version & source: WxPython: 4.2.2 PyPI
Python version & source: Python 3.13
Description of the problem:
TimeCtrl seems to not work. If you press tab while focused on a TimeCtrl, the app crashes. If you select hours and use the spin button, you cannot select minutes and increment them with the spin buttons. It just seems generally unusable.
Example crash:
Code Example (click to expand)
The text was updated successfully, but these errors were encountered: