Prev | Current Page 888 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

You ??™ ll look at using this control first, as it
doesn ??™ t support events:
import nGui.Manager;
import nGui.controls.containers.VBox;
import nGui.controls.containers.Dialog;
import nGui.controls.Label;
class Static
{
public static function main()
{
var bs = new Static();
}
public function new()
{
var mng = new Manager();
var vbox = new VBox();
var lbl1 = new Label( ???This is the nGui label control??? );
var lbl2 = new Label( ???This is aligned right??? );
var lbl3 = new Label( ?????? );
var lbl4 = new Label( ???This is inactive.??? );
lbl2.align = ???RIGHT???;
lbl2.expand = true;
lbl4.active = false;
lbl3.setHSeparator();
vbox.appendChild( lbl1 );
vbox.appendChild( lbl2 );
vbox.appendChild( lbl3 );
vbox.appendChild( lbl4 );
var win : Dialog = new Dialog( vbox );
win.show();
mng.loop();
mng.close();
}
}
If you run this script now, you should be presented with a small window containing several lines of text
and a horizontal divider, as shown in Figure 17 - 1 . Quite a lot is going on here that really only stems from
three new controls: Label , VBox , and Dialog .


Pages:
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900