All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

execute-with-interface Function

Summary

Allows functions to be executed in the event process of a given interface.

Package

capi

Signature

execute-with-interface interface function &rest args

Arguments
interface
function
A function designator.
args
Arguments passed to function.
Description

The function execute-with-interface is a useful way of operating on an interface owned by another process. It takes a top-level interface, a function designator function and some arguments args and queues the function to be run by that process when it next enters its event loop (for an interface owned by the current process, it calls the function immediately).

Notes
  1. execute-with-interface applies function even if interface does not have a screen representation, for example when it is destroyed. To call function only if interface has a representation, use execute-with-interface-if-alive.
  2. All accesses (reads as well as writes) on a CAPI interface and its sub-elements should be performed in the interface process. Within a callback on the interface this happens automatically, but execute-with-interface is a useful utility in other circumstances.
  3. execute-with-interface calls function on the current process if interface does not have a process.
  4. apply-in-pane-process and apply-in-pane-process-if-alive are other ways to call a function in the appropriate CAPI process. They takes panes of all classes, not merely interface.
Examples
(setq a (capi:display (make-instance 'capi:interface)))
(capi:execute-with-interface 
 a 'break 
 "Break inside the interface process")
(example-edit-file "capi/elements/progress-bar-from-background-thread")
See also

apply-in-pane-process
apply-in-pane-process-if-alive
execute-with-interface-if-alive
4.1 The correct thread for CAPI operations
7 Programming with CAPI Windows


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27