Prev | Current Page 897 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

appendChild( lbl );
vert.appendChild( button1 );
button1.onClick = function( val : Int )
{
lbl.text = ???Button pressed = ??? + val;
return null;
}
var wind : Dialog = new Dialog( vert );
wind.title = ???Buttons Sample???;
wind.show();
mng.loop();
}
}
The example should display a dialog, similar to the one detailed in Figure 17 - 3 . Upon clicking the button
control, the onClick event for button1 is fired and the label lbl is updated to show the state of
the button.
Figure 17-3
The Text Control
Just as the Label control facilitates multiple guises, so the Text control also offers more than one display
and can be rendered as either a single - line text field or a multiline field. This is decided when the Text
control is instanced, by passing a Boolean value as the constructor parameter.
Like the Button control, the Text control also provides one event handler, which is fired whenever the
content of the field is changed. The handler for this event accepts two parameters. The first parameter
is the ASCII (American Standard Code for International Interchange) code of the last key pressed, while
the second parameter represents the content of the field should the value be accepted:
textField.


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