A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw71/LW/html/lw-537.htm below:

android-funcall-in-main-thread

Description

The functions android-funcall-in-main-thread and android-funcall-in-main-thread-list arrange for the function func to be applied to the args on the Android main thread (which is the GUI thread too). android-funcall-in-main-thread actually does it by consing func and args and calling android-funcall-in-main-thread-list with the result. android-funcall-in-main-thread-list is the "primitive" interface.

The invocation of the function is done by the event loop of the GUI thread, so it is synchronous with respect to processing events, in other words it will not happen in the middle of processing an event.

These functions should be used when func does something that needs to run on the main thread, most commonly operations that interact with GUI elements.

To allow for testing, these functions can be called on any architecture. On non-Android architectures, there is no "Android main process". In this case, android-funcall-in-main-thread-list first tests whether the variable *android-main-process-for-testing* is non-nil (which value must be a process), and if it is sends func-and-args to this process by process-send. This is based the assumption that this process processes cons events by applying the cl:car to the cl:cdr, which is the "normal" behavior of the system event processing (that is, what general-handle-event does). If you set this variable, make sure that this process processes events in this way. If *android-main-process-for-testing* is nil, android-funcall-in-main-thread-list arranges for the idle process to apply the cl:car to the cl:cdr.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4