HI Gents
Right I've played with the on_main_thread and the ui.in)background and its made no difference.
what I have found is that its the v.present('sheet') command that's causing the problem, I have printed the error messages below
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 11972, TID: 374078, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 PythonistaKit 0x00000001047e1247 View_get_view + 214
5 PythonistaKit 0x00000001047ecb1f View_mapping_get_item + 61
6 PythonistaKit 0x00000001046e1c25 PyEval_EvalFrameEx + 15881
7 PythonistaKit 0x00000001046e4159 fast_function + 282
8 PythonistaKit 0x00000001046de3de PyEval_EvalFrameEx + 1474
9 PythonistaKit 0x00000001046ddbda PyEval_EvalCodeEx + 1576
10 PythonistaKit 0x00000001046dd5ac PyEval_EvalCode + 54
11 PythonistaKit 0x0000000104773710 run_mod + 53
12 PythonistaKit 0x00000001047737b3 PyRun_FileExFlags + 133
13 PythonistaKit 0x0000000104773302 PyRun_SimpleFileExFlags + 698
14 PythonistaKit 0x00000001046b203a -[PythonInterpreter runWithOptions:] + 2265
15 PythonistaKit 0x00000001046b2363 -[PythonInterpreter doDispatchBlockOnInterpreterThread:] + 97
16 Foundation 0x00000001052acc7b __NSThreadPerformPerform + 330
17 CoreFoundation 0x00000001061da721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x00000001061d9f93 __CFRunLoopDoSources0 + 243
19 CoreFoundation 0x00000001061d463f __CFRunLoopRun + 1263
20 CoreFoundation 0x00000001061d3e11 CFRunLoopRunSpecific + 625
21 Foundation 0x0000000105297322 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
22 Foundation 0x0000000105297534 -[NSRunLoop(NSRunLoop) runUntilDate:] + 143
23 Foundation 0x00000001052ac732 __NSThread__start__ + 1221
24 libsystem_pthread.dylib 0x000000010d19633d _pthread_body + 126
25 libsystem_pthread.dylib 0x000000010d1992a7 _pthread_start + 70
26 libsystem_pthread.dylib 0x000000010d195425 thread_start + 13
2018-11-15 16:21:54.014317+0000 My App[11972:374078] [reports] Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 11972, TID: 374078, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 PythonistaKit 0x00000001047e1247 View_get_view + 214
5 PythonistaKit 0x00000001047ecb1f View_mapping_get_item + 61
6 PythonistaKit 0x00000001046e1c25 PyEval_EvalFrameEx + 15881
7 PythonistaKit 0x00000001046e4159 fast_function + 282
8 PythonistaKit 0x00000001046de3de PyEval_EvalFrameEx + 1474
9 PythonistaKit 0x00000001046ddbda PyEval_EvalCodeEx + 1576
10 PythonistaKit 0x00000001046dd5ac PyEval_EvalCode + 54
11 PythonistaKit 0x0000000104773710 run_mod + 53
12 PythonistaKit 0x00000001047737b3 PyRun_FileExFlags + 133
13 PythonistaKit 0x0000000104773302 PyRun_SimpleFileExFlags + 698
14 PythonistaKit 0x00000001046b203a -[PythonInterpreter runWithOptions:] + 2265
15 PythonistaKit 0x00000001046b2363 -[PythonInterpreter doDispatchBlockOnInterpreterThread:] + 97
16 Foundation 0x00000001052acc7b __NSThreadPerformPerform + 330
17 CoreFoundation 0x00000001061da721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x00000001061d9f93 __CFRunLoopDoSources0 + 243
19 CoreFoundation 0x00000001061d463f __CFRunLoopRun + 1263
20 CoreFoundation 0x00000001061d3e11 CFRunLoopRunSpecific + 625
21 Foundation 0x0000000105297322 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
22 Foundation 0x0000000105297534 -[NSRunLoop(NSRunLoop) runUntilDate:] + 143
23 Foundation 0x00000001052ac732 __NSThread__start__ + 1221
24 libsystem_pthread.dylib 0x000000010d19633d _pthread_body + 126
25 libsystem_pthread.dylib 0x000000010d1992a7 _pthread_start + 70
26 libsystem_pthread.dylib 0x000000010d195425 thread_start + 13
and its saying that there is no thread name and its therefore calling it a background call. I put the call into a def and on_main_thread but the message does not change.
@on_main_thread
def setscreen(v,stdtime):
#v=ui.load_view('cql.pyui')
v.present('sheet')
v.background_color = '#00ffff'
label4 = v['label4']
label5 = v['label5']
console.set_idle_timer_disabled(True)
def main():
state=load_state('setup.json')
stdtime = state
load_timers(timer1,timer2,stdtime)
# print timer1,timer2
v = ui.load_view('cql')
v.background_color = '#00ffff'
.
.
#v.present('sheet')
setscreen(v,stdtime)
onscreen = v.on_screen
if onscreen is False:
console.set_idle_timer_disabled(False)
return False
Note not full code shown see previous post for gist.
Any thoughts? The code works - its just this error I can't get rid of!