http://www.newton-inc.com/dev/techinfo/qa/qa.htm
local correctView := GetRoot().correct;
if correctView and (GetCaretBox() or GetHiliteOffsets()) then
correctView:Open();
Note: An older version of this Q&A (from 12/8/95) showed using GetKeyView
as a test to make sure a correctable view was the key view. With the changes to the OS with the Newton 2.1 release that allow any view to be a key view, this is no longer a reliable test. The corrector will fail to open (generating a -48204 "bad path" error) if the key view does not support the caret or a selection. Calling GetCaretBox
and GetHiliteOffsets
is a more reliable test to see if a correctable view is available.