Phoenix
Phoenix copied to clipboard
TimeCtrl is currently broken and unusable
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:
2024-12-14 18:21:23.279 Python[40438:11096613] +[IMKClient subclass]: chose IMKClient_Modern
2024-12-14 18:21:24.985 Python[40438:11096613] +[IMKInputSession subclass]: chose IMKInputSession_Modern
Fatal Python error: PyGILState_Release: thread state 0x103638560 must be current when releasing
Python runtime state: initialized
Current thread 0x00000001fea7fac0 (most recent call first):
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/lib/masked/timectrl.py", line 1214 in SetSelection
File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/lib/masked/textctrl.py", line 140 in _SetSelection
File ???, line 1 in [1] 40438 segmentation fault python3 timeexample.py
Code Example (click to expand)
import wx
import wx.lib.masked as masked
class MyPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
# 12-hour format
text1 = wx.StaticText( self, -1, "12-hour format:", size=(150,-1))
self.time12 = masked.TimeCtrl( self, -1, name="12 hour control" )
h = self.time12.GetSize().height
spin1 = wx.SpinButton(
self, -1, wx.DefaultPosition, (-1,h), wx.SP_VERTICAL )
self.time12.BindSpinButton( spin1 )
self.addWidgets([text1, self.time12, spin1])
# 24-hour format
text2 = wx.StaticText( self, -1, "24-hour format:")
spin2 = wx.SpinButton(
self, -1, wx.DefaultPosition, (-1,h), wx.SP_VERTICAL )
self.time24 = masked.TimeCtrl(
self, -1, name="24 hour control", fmt24hr=True,
spinButton = spin2
)
self.addWidgets([text2, self.time24, spin2])
# No seconds\nor spin button
text3 = wx.StaticText( self, -1, "No seconds\nor spin button:")
self.spinless_ctrl = masked.TimeCtrl(
self, -1, name="spinless control",
display_seconds = False
)
self.addWidgets([text3, self.spinless_ctrl])
# set sizer
self.SetSizer(self.mainSizer)
def addWidgets(self, widgets):
sizer = wx.BoxSizer(wx.HORIZONTAL)
for widget in widgets:
if isinstance(widget, wx.StaticText):
sizer.Add(widget, 0, wx.ALL|wx.CENTER, 5),
else:
sizer.Add(widget, 0, wx.ALL, 5)
self.mainSizer.Add(sizer)
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Spinner Demo")
panel = MyPanel(self)
self.Show()
if __name__ == "__main__":
app = wx.App(False)
f = MyFrame()
app.MainLoop()
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
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Python [45049]
Path: /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python
Identifier: org.python.python
Version: 3.13.0 (3.13.0)
Code Type: ARM-64 (Native)
Parent Process: zsh [1243]
User ID: 501
Date/Time: 2024-12-15 10:36:38.1842 -0700
OS Version: macOS 15.1.1 (24B2091)
Report Version: 12
Anonymous UUID: 58CEFF58-2B34-4CCC-40DE-958582253842
Sleep/Wake UUID: D45FBC21-C832-4D87-80F0-F79BF381F840
Time Awake Since Boot: 660000 seconds
Time Since Wake: 3960 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0073626173690123 -> 0x0000626173690123 (possible pointer authentication failure)
Exception Codes: 0x0000000000000001, 0x0073626173690123
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [45049]
VM Region Info: 0x626173690123 is not in any region. Bytes after previous region: 2617034473764
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
MALLOC_NANO 600000000000-600020000000 [512.0M] rw-/rwx SM=PRV
--->
UNUSED SPACE AT END
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 Python 0x10394ab28 dump_frame + 180
1 Python 0x10394a9a8 dump_traceback + 124
2 Python 0x10394ad04 _Py_DumpTracebackThreads + 312
3 Python 0x1039256d0 fatal_error + 312
4 Python 0x10392a7cc _Py_FatalErrorFormat + 228
5 Python 0x10392f87c PyGILState_Release + 212
6 _core.cpython-313-darwin.so 0x10554b3d4 wxPyThreadBlocker::~wxPyThreadBlocker() + 100
7 _core.cpython-313-darwin.so 0x10566fd80 wxPyCallback::EventThunker(wxEvent&) + 792
8 libwx_baseu-3.2.0.3.0.dylib 0x1042c0eac wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 324
9 libwx_baseu-3.2.0.3.0.dylib 0x1042c0b84 wxEvtHandler::ProcessEventLocally(wxEvent&) + 88
10 libwx_baseu-3.2.0.3.0.dylib 0x1042c09a8 wxEvtHandler::ProcessEvent(wxEvent&) + 56
11 _core.cpython-313-darwin.so 0x10585f6f8 sipwxPyApp::ProcessEvent(wxEvent&) + 144
12 libwx_baseu-3.2.0.3.0.dylib 0x1042c05cc wxEvtHandler::ProcessPendingEvents() + 324
13 libwx_baseu-3.2.0.3.0.dylib 0x1041c8280 wxAppConsoleBase::ProcessPendingEvents() + 204
14 _core.cpython-313-darwin.so 0x10585faf4 sipwxPyApp::ProcessPendingEvents() + 124
15 libwx_baseu-3.2.0.3.0.dylib 0x10429ab50 wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*) + 84
16 CoreFoundation 0x199a25078 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 36
17 CoreFoundation 0x199a24f64 __CFRunLoopDoObservers + 552
18 CoreFoundation 0x199a24594 __CFRunLoopRun + 788
19 CoreFoundation 0x199a23bc4 CFRunLoopRunSpecific + 588
20 HIToolbox 0x1a4e95f64 RunCurrentEventLoopInMode + 292
21 HIToolbox 0x1a4e9bbb4 ReceiveNextEventCommon + 220
22 HIToolbox 0x1a4e9beb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76
23 AppKit 0x19d54f98c _DPSNextEvent + 660
24 AppKit 0x19de8fddc -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688
25 AppKit 0x19d542a64 -[NSApplication run] + 480
26 libwx_osx_cocoau_core-3.2.0.3.0.dylib 0x102ca64c8 wxGUIEventLoop::OSXDoRun() + 140
27 libwx_baseu-3.2.0.3.0.dylib 0x10429b4e0 wxCFEventLoop::DoRun() + 40
28 libwx_baseu-3.2.0.3.0.dylib 0x1041f7f84 wxEventLoopBase::Run() + 200
29 libwx_baseu-3.2.0.3.0.dylib 0x1041c7788 wxAppConsoleBase::MainLoop() + 208
30 _core.cpython-313-darwin.so 0x105861a44 meth_wxPyApp_MainLoop(_object*, _object*) + 216
31 Python 0x103762f94 cfunction_call + 116
32 Python 0x10388595c _PyEval_EvalFrameDefault + 42172
33 Python 0x103878fc4 PyEval_EvalCode + 132
34 Python 0x103931198 run_eval_code_obj + 144
35 Python 0x103930bb8 run_mod + 168
36 Python 0x1039309e0 pyrun_file + 144
37 Python 0x1039302dc _PyRun_SimpleFileObject + 260
38 Python 0x10392fbdc _PyRun_AnyFileObject + 80
39 Python 0x10395dadc pymain_run_file_obj + 164
40 Python 0x10395d218 pymain_run_file + 72
41 Python 0x10395c56c Py_RunMain + 888
42 Python 0x10395ddcc pymain_main + 500
43 Python 0x10395df34 Py_BytesMain + 40
44 dyld 0x1995bc274 start + 2840
Thread 1:
0 libsystem_pthread.dylib 0x19993a0e8 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x19993a0e8 start_wqthread + 0
Thread 3:
0 libsystem_pthread.dylib 0x19993a0e8 start_wqthread + 0
Thread 4:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x1998fde34 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1999105d0 mach_msg2_internal + 80
2 libsystem_kernel.dylib 0x1999069d8 mach_msg_overwrite + 480
3 libsystem_kernel.dylib 0x1998fe17c mach_msg + 24
4 CoreFoundation 0x199a25edc __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x199a2473c __CFRunLoopRun + 1212
6 CoreFoundation 0x199a23bc4 CFRunLoopRunSpecific + 588
7 AppKit 0x19d674b10 _NSEventThread + 148
8 libsystem_pthread.dylib 0x19993f2e4 _pthread_start + 136
9 libsystem_pthread.dylib 0x19993a0fc thread_start + 8
Thread 5:
0 libsystem_pthread.dylib 0x19993a0e8 start_wqthread + 0
Thread 6:
0 libsystem_pthread.dylib 0x19993a0e8 start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000004 x1: 0x0000000103a1670a x2: 0x0000000000000004 x3: 0x0000000000000000
x4: 0x00000000ffffffff x5: 0x000000016d484ca0 x6: 0x0000000000000067 x7: 0x0000000000000c30
x8: 0x0073626173690078 x9: 0x00000001fea8a188 x10: 0xcccccccccccccccd x11: 0x00000000000000f6
x12: 0x000000016d484b63 x13: 0x0000000000000000 x14: 0x0000000000000031 x15: 0x0000000103ed9726
x16: 0x00000001998fe7d0 x17: 0x0000600000c4f6e0 x18: 0x0000000000000000 x19: 0x0000000000000002
x20: 0x0000000000000001 x21: 0x0000000000000062 x22: 0x5800000103b633d0 x23: 0x0000000103a130b8
x24: 0x0000000000000000 x25: 0x000000000000000c x26: 0x000000010436ccf0 x27: 0x0000000000000000
x28: 0x0000000000000000 fp: 0x000000016d484bb0 lr: 0x000000010394ab1c
sp: 0x000000016d484b90 pc: 0x000000010394ab28 cpsr: 0x20000000
far: 0x0073626173690123 esr: 0x92000004 (Data Abort) byte read Translation fault
Binary Images:
0x102978000 - 0x10297bfff org.python.python (3.13.0) <53936d74-c619-3546-af3d-11865ba3db8b> /Library/Frameworks/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python
0x10365c000 - 0x103adbfff org.python.python (3.13.0, (c) 2001-2024 Python Software Foundation.) <8444b9d7-1ee5-375a-8077-852c816e3205> /Library/Frameworks/Python.framework/Versions/3.13/Python
0x105540000 - 0x105af3fff _core.cpython-313-darwin.so (*) <5082d082-d2d3-31a8-9163-2e547f680934> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/_core.cpython-313-darwin.so
0x102be8000 - 0x10308ffff libwx_osx_cocoau_core-3.2.0.3.0.dylib (*) <2635a696-b500-3f26-8348-b6ad00436087> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/libwx_osx_cocoau_core-3.2.0.3.0.dylib
0x103468000 - 0x1034a3fff libwx_baseu_net-3.2.0.3.0.dylib (*) <cea927c3-c915-392b-bd8b-e3d343260ef7> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/libwx_baseu_net-3.2.0.3.0.dylib
0x1041bc000 - 0x10434ffff libwx_baseu-3.2.0.3.0.dylib (*) <b4639743-78e2-3602-ab57-b9c592df459a> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/libwx_baseu-3.2.0.3.0.dylib
0x103398000 - 0x1033b3fff siplib.cpython-313-darwin.so (*) <16dfceab-839c-3766-b444-da9d11bdef4f> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/wx/siplib.cpython-313-darwin.so
0x1034d0000 - 0x1034e3fff _datetime.cpython-313-darwin.so (*) <b7c4d380-856b-33f8-b4fa-42016cc38377> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_datetime.cpython-313-darwin.so
0x103424000 - 0x103427fff _heapq.cpython-313-darwin.so (*) <ede9d788-499c-3642-832e-eef02c67b86c> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_heapq.cpython-313-darwin.so
0x103400000 - 0x103407fff _struct.cpython-313-darwin.so (*) <b798ab30-365d-3821-9016-8192fc2cb7a4> /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_struct.cpython-313-darwin.so
0x1091f8000 - 0x109203fff libobjc-trampolines.dylib (*) <f1242604-dcb7-30a9-a19a-182991e6e645> /usr/lib/libobjc-trampolines.dylib
0x10ad28000 - 0x10b48bfff com.apple.AGXMetalG16G-B0 (322.10) <ffa8f3da-c294-327e-8614-1f36026c0730> /System/Library/Extensions/AGXMetalG16G_B0.bundle/Contents/MacOS/AGXMetalG16G_B0
0x1999a8000 - 0x199e9cfff com.apple.CoreFoundation (6.9) <ae4610f8-7c5c-3484-858e-cae7457d206e> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x1a4d8a000 - 0x1a5091fff com.apple.HIToolbox (2.1.1) <7129a8bf-ce8b-39c6-8565-b280af625fac> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x19d515000 - 0x19e910fff com.apple.AppKit (6.9) <f6d80158-7279-340b-81e7-94e875967778> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x1995b6000 - 0x1996387b7 dyld (*) <5ca59b26-65ac-3e9a-89bd-3ffd45a097c2> /usr/lib/dyld
0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
0x1998fd000 - 0x199937ff7 libsystem_kernel.dylib (*) <9fea25a4-e8ca-3f3d-901c-a53ff2bc7217> /usr/lib/system/libsystem_kernel.dylib
0x199938000 - 0x199944fff libsystem_pthread.dylib (*) <97366a98-0b27-364f-bf0e-395bf521343f> /usr/lib/system/libsystem_pthread.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=1.3G resident=0K(0%) swapped_out_or_unallocated=1.3G(100%)
Writable regions: Total=1.6G written=641K(0%) resident=641K(0%) swapped_out=0K(0%) unallocated=1.6G(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Accelerate framework 256K 2
Activity Tracing 256K 1
CG image 176K 6
ColorSync 576K 28
CoreAnimation 784K 25
CoreGraphics 32K 2
CoreUI image data 1520K 11
Foundation 48K 2
Kernel Alloc Once 32K 1
MALLOC 1.6G 63
MALLOC guard page 288K 18
STACK GUARD 112K 7
Stack 19.2M 7
VM_ALLOCATE 6352K 16
__AUTH 3367K 445
__AUTH_CONST 48.6M 644
__CTF 824 1
__DATA 18.1M 633
__DATA_CONST 20.2M 659
__DATA_DIRTY 1807K 222
__FONT_DATA 2352 1
__LINKEDIT 595.9M 13
__OBJC_RW 2355K 1
__TEXT 765.8M 676
__TPRO_CONST 272K 2
mapped file 242.1M 31
owned unmapped memory 864K 1
page table in kernel 641K 1
shared memory 896K 17
=========== ======= =======
TOTAL 3.3G 3536
-----------
Full Report
-----------
{"app_name":"Python","timestamp":"2024-12-15 10:36:40.00 -0700","app_version":"3.13.0","slice_uuid":"53936d74-c619-3546-af3d-11865ba3db8b","build_version":"3.13.0","platform":1,"bundleID":"org.python.python","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 15.1.1 (24B2091)","roots_installed":0,"name":"Python","incident_id":"1803986B-E356-4D59-8681-FF6D8B027FC8"}
{
"uptime" : 660000,
"procRole" : "Foreground",
"version" : 2,
"userID" : 501,
"deployVersion" : 210,
"modelCode" : "Mac16,1",
"coalitionID" : 1102,
"osVersion" : {
"train" : "macOS 15.1.1",
"build" : "24B2091",
"releaseType" : "User"
},
"captureTime" : "2024-12-15 10:36:38.1842 -0700",
"codeSigningMonitor" : 2,
"incident" : "1803986B-E356-4D59-8681-FF6D8B027FC8",
"pid" : 45049,
"translated" : false,
"cpuType" : "ARM-64",
"roots_installed" : 0,
"bug_type" : "309",
"procLaunch" : "2024-12-15 10:36:32.5584 -0700",
"procStartAbsTime" : 16063028919932,
"procExitAbsTime" : 16063163406951,
"procName" : "Python",
"procPath" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/Resources\/Python.app\/Contents\/MacOS\/Python",
"bundleInfo" : {"CFBundleShortVersionString":"3.13.0","CFBundleVersion":"3.13.0","CFBundleIdentifier":"org.python.python"},
"storeInfo" : {"deviceIdentifierForVendor":"13FF48C0-3ED7-5ABC-8E22-70DA3BBF35D0","thirdParty":true},
"parentProc" : "zsh",
"parentPid" : 1243,
"coalitionName" : "com.googlecode.iterm2",
"crashReporterKey" : "58CEFF58-2B34-4CCC-40DE-958582253842",
"responsiblePid" : 1208,
"codeSigningID" : "org.python.python",
"codeSigningTeamID" : "BMM5U3QVKW",
"codeSigningFlags" : 570491393,
"codeSigningValidationCategory" : 6,
"codeSigningTrustLevel" : 4294967295,
"instructionByteStream" : {"beforePC":"vP7\/lwEGANAhbB6R4AMTqoIAgFIDAIBSOkAAlME+QPmBAAC0KARA+Q==","atPC":"CK1COagEIDcBBgDQITwekeADE6piAIBSAwCAUi9AAJRBBgCwIeACkQ=="},
"bootSessionUUID" : "9CB223E8-BA99-440B-A7A1-9DCA96D2C4A8",
"wakeTime" : 3960,
"sleepWakeUUID" : "D45FBC21-C832-4D87-80F0-F79BF381F840",
"sip" : "enabled",
"vmRegionInfo" : "0x626173690123 is not in any region. Bytes after previous region: 2617034473764 \n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n MALLOC_NANO 600000000000-600020000000 [512.0M] rw-\/rwx SM=PRV \n---> \n UNUSED SPACE AT END",
"exception" : {"codes":"0x0000000000000001, 0x0073626173690123","rawCodes":[1,32477793009336611],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0073626173690123 -> 0x0000626173690123 (possible pointer authentication failure)"},
"termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":45049},
"vmregioninfo" : "0x626173690123 is not in any region. Bytes after previous region: 2617034473764 \n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n MALLOC_NANO 600000000000-600020000000 [512.0M] rw-\/rwx SM=PRV \n---> \n UNUSED SPACE AT END",
"extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
"faultingThread" : 0,
"threads" : [{"triggered":true,"id":22631983,"threadState":{"x":[{"value":4},{"value":4355876618},{"value":4},{"value":0},{"value":4294967295},{"value":6128422048},{"value":103},{"value":3120},{"value":32477793009336440},{"value":8567431560,"symbolLocation":0,"symbol":"errno"},{"value":14757395258967641293},{"value":246},{"value":6128421731},{"value":0},{"value":49},{"value":4360869670},{"value":6871312336,"symbolLocation":0,"symbol":"__error"},{"value":105553129174752},{"value":0},{"value":2},{"value":1},{"value":98},{"value":6341068279694898128,"symbolLocation":6341068275337658368,"symbol":"_Py_NoneStruct"},{"value":4355862712},{"value":0},{"value":12},{"value":4365667568,"symbolLocation":0,"symbol":"wxTheAssertHandler"},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4355042076},"cpsr":{"value":536870912},"fp":{"value":6128421808},"sp":{"value":6128421776},"esr":{"value":2449473540,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":4355042088,"matchesCrashFrame":1},"far":{"value":32477793009336611}},"queue":"com.apple.main-thread","frames":[{"imageOffset":3074856,"symbol":"dump_frame","symbolLocation":180,"imageIndex":1},{"imageOffset":3074472,"symbol":"dump_traceback","symbolLocation":124,"imageIndex":1},{"imageOffset":3075332,"symbol":"_Py_DumpTracebackThreads","symbolLocation":312,"imageIndex":1},{"imageOffset":2922192,"symbol":"fatal_error","symbolLocation":312,"imageIndex":1},{"imageOffset":2942924,"symbol":"_Py_FatalErrorFormat","symbolLocation":228,"imageIndex":1},{"imageOffset":2963580,"symbol":"PyGILState_Release","symbolLocation":212,"imageIndex":1},{"imageOffset":46036,"symbol":"wxPyThreadBlocker::~wxPyThreadBlocker()","symbolLocation":100,"imageIndex":2},{"imageOffset":1244544,"symbol":"wxPyCallback::EventThunker(wxEvent&)","symbolLocation":792,"imageIndex":2},{"imageOffset":1068716,"symbol":"wxEvtHandler::SearchDynamicEventTable(wxEvent&)","symbolLocation":324,"imageIndex":5},{"imageOffset":1067908,"symbol":"wxEvtHandler::ProcessEventLocally(wxEvent&)","symbolLocation":88,"imageIndex":5},{"imageOffset":1067432,"symbol":"wxEvtHandler::ProcessEvent(wxEvent&)","symbolLocation":56,"imageIndex":5},{"imageOffset":3274488,"symbol":"sipwxPyApp::ProcessEvent(wxEvent&)","symbolLocation":144,"imageIndex":2},{"imageOffset":1066444,"symbol":"wxEvtHandler::ProcessPendingEvents()","symbolLocation":324,"imageIndex":5},{"imageOffset":49792,"symbol":"wxAppConsoleBase::ProcessPendingEvents()","symbolLocation":204,"imageIndex":5},{"imageOffset":3275508,"symbol":"sipwxPyApp::ProcessPendingEvents()","symbolLocation":124,"imageIndex":2},{"imageOffset":912208,"symbol":"wxCFEventLoop::OSXCommonModeObserverCallBack(__CFRunLoopObserver*, int, void*)","symbolLocation":84,"imageIndex":5},{"imageOffset":512120,"symbol":"__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__","symbolLocation":36,"imageIndex":12},{"imageOffset":511844,"symbol":"__CFRunLoopDoObservers","symbolLocation":552,"imageIndex":12},{"imageOffset":509332,"symbol":"__CFRunLoopRun","symbolLocation":788,"imageIndex":12},{"imageOffset":506820,"symbol":"CFRunLoopRunSpecific","symbolLocation":588,"imageIndex":12},{"imageOffset":1097572,"symbol":"RunCurrentEventLoopInMode","symbolLocation":292,"imageIndex":13},{"imageOffset":1121204,"symbol":"ReceiveNextEventCommon","symbolLocation":220,"imageIndex":13},{"imageOffset":1121976,"symbol":"_BlockUntilNextEventMatchingListInModeWithFilter","symbolLocation":76,"imageIndex":13},{"imageOffset":240012,"symbol":"_DPSNextEvent","symbolLocation":660,"imageIndex":14},{"imageOffset":9940444,"symbol":"-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]","symbolLocation":688,"imageIndex":14},{"imageOffset":186980,"symbol":"-[NSApplication run]","symbolLocation":480,"imageIndex":14},{"imageOffset":779464,"symbol":"wxGUIEventLoop::OSXDoRun()","symbolLocation":140,"imageIndex":3},{"imageOffset":914656,"symbol":"wxCFEventLoop::DoRun()","symbolLocation":40,"imageIndex":5},{"imageOffset":245636,"symbol":"wxEventLoopBase::Run()","symbolLocation":200,"imageIndex":5},{"imageOffset":46984,"symbol":"wxAppConsoleBase::MainLoop()","symbolLocation":208,"imageIndex":5},{"imageOffset":3283524,"symbol":"meth_wxPyApp_MainLoop(_object*, _object*)","symbolLocation":216,"imageIndex":2},{"imageOffset":1077140,"symbol":"cfunction_call","symbolLocation":116,"imageIndex":1},{"imageOffset":2267484,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":42172,"imageIndex":1},{"imageOffset":2215876,"symbol":"PyEval_EvalCode","symbolLocation":132,"imageIndex":1},{"imageOffset":2970008,"symbol":"run_eval_code_obj","symbolLocation":144,"imageIndex":1},{"imageOffset":2968504,"symbol":"run_mod","symbolLocation":168,"imageIndex":1},{"imageOffset":2968032,"symbol":"pyrun_file","symbolLocation":144,"imageIndex":1},{"imageOffset":2966236,"symbol":"_PyRun_SimpleFileObject","symbolLocation":260,"imageIndex":1},{"imageOffset":2964444,"symbol":"_PyRun_AnyFileObject","symbolLocation":80,"imageIndex":1},{"imageOffset":3152604,"symbol":"pymain_run_file_obj","symbolLocation":164,"imageIndex":1},{"imageOffset":3150360,"symbol":"pymain_run_file","symbolLocation":72,"imageIndex":1},{"imageOffset":3147116,"symbol":"Py_RunMain","symbolLocation":888,"imageIndex":1},{"imageOffset":3153356,"symbol":"pymain_main","symbolLocation":500,"imageIndex":1},{"imageOffset":3153716,"symbol":"Py_BytesMain","symbolLocation":40,"imageIndex":1},{"imageOffset":25204,"symbol":"start","symbolLocation":2840,"imageIndex":15}]},{"id":22631989,"frames":[{"imageOffset":8424,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":18}],"threadState":{"x":[{"value":6128988160},{"value":4611},{"value":6128451584},{"value":0},{"value":409604},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":0},"fp":{"value":0},"sp":{"value":6128988160},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6871556328},"far":{"value":0}}},{"id":22631990,"frames":[{"imageOffset":8424,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":18}],"threadState":{"x":[{"value":6129561600},{"value":8963},{"value":6129025024},{"value":0},{"value":409604},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":0},"fp":{"value":0},"sp":{"value":6129561600},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6871556328},"far":{"value":0}}},{"id":22632007,"frames":[{"imageOffset":8424,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":18}],"threadState":{"x":[{"value":6130135040},{"value":20239},{"value":6129598464},{"value":0},{"value":409602},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":0},"fp":{"value":0},"sp":{"value":6130135040},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6871556328},"far":{"value":0}}},{"id":22632012,"name":"com.apple.NSEventThread","threadState":{"x":[{"value":268451845},{"value":21592279046},{"value":8589934592},{"value":111063559307264},{"value":0},{"value":111063559307264},{"value":2},{"value":4294967295},{"value":18446744073709550527},{"value":2},{"value":0},{"value":0},{"value":0},{"value":25859},{"value":0},{"value":0},{"value":18446744073709551569},{"value":8704097152},{"value":0},{"value":4294967295},{"value":2},{"value":111063559307264},{"value":0},{"value":111063559307264},{"value":6130704488},{"value":8589934592},{"value":21592279046},{"value":21592279046},{"value":4412409862}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6871385552},"cpsr":{"value":0},"fp":{"value":6130704336},"sp":{"value":6130704256},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":6871309876},"far":{"value":0}},"frames":[{"imageOffset":3636,"symbol":"mach_msg2_trap","symbolLocation":8,"imageIndex":17},{"imageOffset":79312,"symbol":"mach_msg2_internal","symbolLocation":80,"imageIndex":17},{"imageOffset":39384,"symbol":"mach_msg_overwrite","symbolLocation":480,"imageIndex":17},{"imageOffset":4476,"symbol":"mach_msg","symbolLocation":24,"imageIndex":17},{"imageOffset":515804,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":160,"imageIndex":12},{"imageOffset":509756,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":12},{"imageOffset":506820,"symbol":"CFRunLoopRunSpecific","symbolLocation":588,"imageIndex":12},{"imageOffset":1440528,"symbol":"_NSEventThread","symbolLocation":148,"imageIndex":14},{"imageOffset":29412,"symbol":"_pthread_start","symbolLocation":136,"imageIndex":18},{"imageOffset":8444,"symbol":"thread_start","symbolLocation":8,"imageIndex":18}]},{"id":22632124,"frames":[{"imageOffset":8424,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":18}],"threadState":{"x":[{"value":6131281920},{"value":0},{"value":6130745344},{"value":0},{"value":278532},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":0},"fp":{"value":0},"sp":{"value":6131281920},"esr":{"value":0,"description":" Address size fault"},"pc":{"value":6871556328},"far":{"value":0}}},{"id":22632125,"frames":[{"imageOffset":8424,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":18}],"threadState":{"x":[{"value":6131855360},{"value":0},{"value":6131318784},{"value":0},{"value":278532},{"value":18446744073709551615},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":0},"cpsr":{"value":0},"fp":{"value":0},"sp":{"value":6131855360},"esr":{"value":0,"description":" Address size fault"},"pc":{"value":6871556328},"far":{"value":0}}}],
"usedImages" : [
{
"source" : "P",
"arch" : "arm64",
"base" : 4338450432,
"CFBundleShortVersionString" : "3.13.0",
"CFBundleIdentifier" : "org.python.python",
"size" : 16384,
"uuid" : "53936d74-c619-3546-af3d-11865ba3db8b",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/Resources\/Python.app\/Contents\/MacOS\/Python",
"name" : "Python",
"CFBundleVersion" : "3.13.0"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4351967232,
"CFBundleShortVersionString" : "3.13.0, (c) 2001-2024 Python Software Foundation.",
"CFBundleIdentifier" : "org.python.python",
"size" : 4718592,
"uuid" : "8444b9d7-1ee5-375a-8077-852c816e3205",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/Python",
"name" : "Python",
"CFBundleVersion" : "3.13.0"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4384358400,
"size" : 5980160,
"uuid" : "5082d082-d2d3-31a8-9163-2e547f680934",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/site-packages\/wx\/_core.cpython-313-darwin.so",
"name" : "_core.cpython-313-darwin.so"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4341006336,
"size" : 4882432,
"uuid" : "2635a696-b500-3f26-8348-b6ad00436087",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/site-packages\/wx\/libwx_osx_cocoau_core-3.2.0.3.0.dylib",
"name" : "libwx_osx_cocoau_core-3.2.0.3.0.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4349919232,
"size" : 245760,
"uuid" : "cea927c3-c915-392b-bd8b-e3d343260ef7",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/site-packages\/wx\/libwx_baseu_net-3.2.0.3.0.dylib",
"name" : "libwx_baseu_net-3.2.0.3.0.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4363894784,
"size" : 1654784,
"uuid" : "b4639743-78e2-3602-ab57-b9c592df459a",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/site-packages\/wx\/libwx_baseu-3.2.0.3.0.dylib",
"name" : "libwx_baseu-3.2.0.3.0.dylib"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4349067264,
"size" : 114688,
"uuid" : "16dfceab-839c-3766-b444-da9d11bdef4f",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/site-packages\/wx\/siplib.cpython-313-darwin.so",
"name" : "siplib.cpython-313-darwin.so"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4350345216,
"size" : 81920,
"uuid" : "b7c4d380-856b-33f8-b4fa-42016cc38377",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_datetime.cpython-313-darwin.so",
"name" : "_datetime.cpython-313-darwin.so"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4349640704,
"size" : 16384,
"uuid" : "ede9d788-499c-3642-832e-eef02c67b86c",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_heapq.cpython-313-darwin.so",
"name" : "_heapq.cpython-313-darwin.so"
},
{
"source" : "P",
"arch" : "arm64",
"base" : 4349493248,
"size" : 32768,
"uuid" : "b798ab30-365d-3821-9016-8192fc2cb7a4",
"path" : "\/Library\/Frameworks\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_struct.cpython-313-darwin.so",
"name" : "_struct.cpython-313-darwin.so"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 4448026624,
"size" : 49152,
"uuid" : "f1242604-dcb7-30a9-a19a-182991e6e645",
"path" : "\/usr\/lib\/libobjc-trampolines.dylib",
"name" : "libobjc-trampolines.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 4476534784,
"CFBundleShortVersionString" : "322.10",
"CFBundleIdentifier" : "com.apple.AGXMetalG16G-B0",
"size" : 7749632,
"uuid" : "ffa8f3da-c294-327e-8614-1f36026c0730",
"path" : "\/System\/Library\/Extensions\/AGXMetalG16G_B0.bundle\/Contents\/MacOS\/AGXMetalG16G_B0",
"name" : "AGXMetalG16G_B0",
"CFBundleVersion" : "322.10"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6872006656,
"CFBundleShortVersionString" : "6.9",
"CFBundleIdentifier" : "com.apple.CoreFoundation",
"size" : 5197824,
"uuid" : "ae4610f8-7c5c-3484-858e-cae7457d206e",
"path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
"name" : "CoreFoundation",
"CFBundleVersion" : "3107"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 7060627456,
"CFBundleShortVersionString" : "2.1.1",
"CFBundleIdentifier" : "com.apple.HIToolbox",
"size" : 3178496,
"uuid" : "7129a8bf-ce8b-39c6-8565-b280af625fac",
"path" : "\/System\/Library\/Frameworks\/Carbon.framework\/Versions\/A\/Frameworks\/HIToolbox.framework\/Versions\/A\/HIToolbox",
"name" : "HIToolbox"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6934319104,
"CFBundleShortVersionString" : "6.9",
"CFBundleIdentifier" : "com.apple.AppKit",
"size" : 20955136,
"uuid" : "f6d80158-7279-340b-81e7-94e875967778",
"path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit",
"name" : "AppKit",
"CFBundleVersion" : "2575.20.21"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6867869696,
"size" : 534456,
"uuid" : "5ca59b26-65ac-3e9a-89bd-3ffd45a097c2",
"path" : "\/usr\/lib\/dyld",
"name" : "dyld"
},
{
"size" : 0,
"source" : "A",
"base" : 0,
"uuid" : "00000000-0000-0000-0000-000000000000"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6871306240,
"size" : 241656,
"uuid" : "9fea25a4-e8ca-3f3d-901c-a53ff2bc7217",
"path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
"name" : "libsystem_kernel.dylib"
},
{
"source" : "P",
"arch" : "arm64e",
"base" : 6871547904,
"size" : 53248,
"uuid" : "97366a98-0b27-364f-bf0e-395bf521343f",
"path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
"name" : "libsystem_pthread.dylib"
}
],
"sharedCache" : {
"base" : 6867058688,
"size" : 4754456576,
"uuid" : "e60d076c-03c2-3631-b60c-656c31eb75f8"
},
"vmSummary" : "ReadOnly portion of Libraries: Total=1.3G resident=0K(0%) swapped_out_or_unallocated=1.3G(100%)\nWritable regions: Total=1.6G written=641K(0%) resident=641K(0%) swapped_out=0K(0%) unallocated=1.6G(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nAccelerate framework 256K 2 \nActivity Tracing 256K 1 \nCG image 176K 6 \nColorSync 576K 28 \nCoreAnimation 784K 25 \nCoreGraphics 32K 2 \nCoreUI image data 1520K 11 \nFoundation 48K 2 \nKernel Alloc Once 32K 1 \nMALLOC 1.6G 63 \nMALLOC guard page 288K 18 \nSTACK GUARD 112K 7 \nStack 19.2M 7 \nVM_ALLOCATE 6352K 16 \n__AUTH 3367K 445 \n__AUTH_CONST 48.6M 644 \n__CTF 824 1 \n__DATA 18.1M 633 \n__DATA_CONST 20.2M 659 \n__DATA_DIRTY 1807K 222 \n__FONT_DATA 2352 1 \n__LINKEDIT 595.9M 13 \n__OBJC_RW 2355K 1 \n__TEXT 765.8M 676 \n__TPRO_CONST 272K 2 \nmapped file 242.1M 31 \nowned unmapped memory 864K 1 \npage table in kernel 641K 1 \nshared memory 896K 17 \n=========== ======= ======= \nTOTAL 3.3G 3536 \n",
"legacyInfo" : {
"threadTriggered" : {
"queue" : "com.apple.main-thread"
}
},
"logWritingSignature" : "b390d69bbe022b2de6d84a107a2027d4506a4fad",
"trialInfo" : {
"rollouts" : [
{
"rolloutId" : "654d8c0661e7447155256fcd",
"factorPackIds" : {
"SIRI_TEXT_TO_SPEECH" : "67510049a49ead2c9b84cc22"
},
"deploymentId" : 240000250
},
{
"rolloutId" : "642da32dea3b2418c750f848",
"factorPackIds" : {
"VISUAL_INTELLIGENCE_VICTORIA" : "66d8b2f77cd4b62688efd2cf"
},
"deploymentId" : 240000004
}
],
"experiments" : [
]
}
}
Just to add more information.
- Left right arrow keys do not navigate the fields of the time control like they do on other OSs.
- Up and down keys do not increment the fields via the bound spin buttons like they do in other OSs, but the spin buttons do work on the current field.
- Manually selecting a field will cause a field to be selected on the first attempt, but not on subsequent attempts. You have to manually select and edit the field to cause the field to then be selected. I don't think this is true on other OSs.
- Shift tab seems to navigate fields in the reverse direction as intended.
- Tab does not seem to navigate fields in the forward direction and causes the application to crash.
- You can manually modify fields to some degree, but if you insert a
:it will also crash instead of properly inserting it and navigating to the appropriate field. Maybe because this simulates a forward tab.
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.
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.
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.
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.
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. The Up key acts like a Home key and moves the caret to the start of the control. The Down key acts like an End key and moves the caret to the end of the control. The Left and Right keys move the caret as in a plain TextCtrl and don't jump between the hours, minutes, seconds, am/pm fields and select them as they do on Linux. Backspace deletes characters to left of caret on MacBook, but just causes a beep on Linux.
The Up key acts like a Home key and moves the caret to the start of the control. The Down key acts like an End key and moves the caret to the end of the control. The Left and Right keys move the caret as in a plain TextCtrl and don't jump between the hours, minutes, seconds, am/pm fields and select them as they do on Linux. Backspace deletes characters to left of caret on MacBook, but just causes a beep on Linux.
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 : crashes the app, it makes timectrl almost completely unusable.
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. If I then press the '1' key it overtypes the colon. Pressing ':' is then rejected. I then start getting tracebacks on stderr such as:
Traceback (most recent call last):
File "/home/richardt/.local/lib/python3.12/site-packages/wx/core.py", line 3427, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richardt/.local/lib/python3.12/site-packages/wx/lib/masked/maskededit.py", line 5651, in _fixSelection
elif sel_start > self._goEnd(getPosOnly=True):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richardt/.local/lib/python3.12/site-packages/wx/lib/masked/maskededit.py", line 4591, in _goEnd
char = text[i]
~~~~^^^
IndexError: string index out of range
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.
https://github.com/wxWidgets/Phoenix/issues/2587
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.
I just ran into this problem too (and only on macOS). FWIW, wx.adv.DatePickerCtrl and wx.adv.TimePickerCtrl work fine for me. Modifying the original to be:
import wx
import wx.adv
class MyPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, label="wx.adv date picker")
wdate = wx.adv.DatePickerCtrl(self, style=wx.adv.DP_DROPDOWN|wx.adv.DP_SHOWCENTURY)
self.addWidgets([text, wdate])
text = wx.StaticText(self, label="wx.adv time picker")
wtime = wx.adv.TimePickerCtrl(self)
self.addWidgets([text, wtime])
# set sizer
self.SetSizer(self.mainSizer)
def addWidgets(self, widgets):
sizer = wx.BoxSizer(wx.HORIZONTAL)
for widget in widgets:
if isinstance(widget, wx.StaticText):
sizer.Add(widget, 0, wx.ALL|wx.CENTER, 5),
else:
sizer.Add(widget, 0, wx.ALL, 5)
self.mainSizer.Add(sizer)
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Spinner Demo")
panel = MyPanel(self)
self.Show()
if __name__ == "__main__":
app = wx.App(False)
f = MyFrame()
app.MainLoop()
does not crash for me.