Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 1 - Newton Works / Newton Works Interface Reference
Newton Works Viewdef Slots and Methods /


FindChange

viewDef:FindChange(action, data)

Called when the user performs a Find operation from Newton Works Find/Change slip.

action
A symbol indicating the action the user requested: 'find, 'change, or 'changeAll.

data
Varies depending on the value of action. See Table 1-1 for details.

return value
Varies depending on the value of action. See Table 1-1 for details.

DISCUSSION

Table 1-1 explains what you should do in this method, the value of the data parameter, and what you should return. This method also is responsible for updating the view appropriately. For example, if action is 'find, you must scroll to the first found item and highlight it.

Table 1-1 FindChange parameters and actions
action valuedata valueFindChange method should do this
'findA string to find.Search for the next string that matches, starting from the current selection. The search should wrap if necessary. Return true if the string is found, nil if not.
'changeA frame with slots findStr (string to find) and changeStr (string to replace with).Replace the current selection with changeStr. If findStr does not match the current selection, this is an error condition. Return true if the selection is replaced with changeStr, nil if not.
'changeAllA frame with slots findStr (string to find) and changeStr (string to replace with).Replace all instances of findStr with changeStr. Return the number of instances replaced, as an integer.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help