on-change-test

Generic Function

Package: common-graphics

Arguments: dialog-item

Returns the value of the on-change-test event property of dialog-item. The value of the on-change-test property should be a function object or a function name (a suymbol naming a function). This function is called to determine whether an apparent change in the value of dialog-item should trigger a call to the on-change function.

The function should take two arguments, the old value and the new value.

The function should return nil if the values are different (returning nil is the definition of the values being different) and return true if the values are the same. The initial value is typically eql.

The on-change-test is also used internally to find values in some kinds of controls. For example, when the value of an item-list control is set, the range of values is searched for the new value, using the on-change-test to test whether each range value is equivalent to the new value so that it may be selected. If the item-list uses string values, for example, then the default on-change-test of eql will typically not find a new value in the range, since two strings are typically eql to each other (we say typically because there are cases when both as a constant string and thus are eq and thus eql). In this case, the on-change-test should be a function like string-equal that will return true for equivalent strings. (A more efficient approach may be to use symbols or other objects for which eql suffices, and use an on-print function to convert that object to the string to be displayed.)

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm. See also About event handling in the IDE in that document.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.