Title: capi:editor-pane operations malfunctioning on Cocoa
|Product: LispWorks for Macintosh|
OS: Mac OS X
Editor commands and functions may not always work correctly in your interfaces on Cocoa when called in code which works correctly on other platforms. Failure to scroll or failure to update the cursor position are instances of this problem.
The issue is that editor operations need to run in their own thread in LispWorks on Mac OS X, not in the thread of the CAPI window.
The way to initiate this is using the function editor:process-character which can be passed a list containing a function and its arguments. For example:
(defun set-buffer-file (ed path)
(let* ((pane (edit-pane ed))
(buff (capi:editor-pane-buffer pane))
(window (capi:editor-window pane)))
`(editor:find-alternate-file-command nil ,path ,buff)
Such code is portable to other platforms.
Note that you should not perform CAPI operations using editor:process-character, only editor operations.
|See Also: |