Prev | Current Page 898 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

onChange = function( code : Int, content : String ) : Int
{
neko.Lib.println( ???The key ?????? + code + ?????™ was added to ?????? + content + ?????™??? );
}
490
Part III: Extending the Possibilities
The return code of the onChange event can be either an integer representation of a ReturnType
enumerator value or the ASCII value of a key you wish rendered instead. The ReturnType enumerator
provides four values representing the type of value returnable from an nGui callback. These are
DEFAULT , CLOSE , CONTINUE , and IGNORE . Normally, DEFAULT and IGNORE perform the same function,
except under special circumstances, while the CLOSE value causes the application loop to end, and
CONTINUE passes the event to the parent control.
As ReturnType cannot automatically be converted to an integer value, the Control class provides the
function RTToInt . This method must be called if a ReturnType enumerator is used. Here is an example
of how the Text control might be used:
import nGui.Manager;
import nGui.controls.


Pages:
886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910