Prev | Current Page 912 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

The following example shows the menu framework in
action and illustrates how the menu events might be used. Figure 17 - 7 then shows how this example
should look.
import nGui.Manager;
import nGui.controls.Label;
import nGui.controls.menu.Menu;
(continued)
498
Part III: Extending the Possibilities
import nGui.controls.menu.IMenu;
import nGui.controls.menu.Submenu;
import nGui.controls.menu.Item;
import nGui.controls.containers.Dialog;
class MenuSample
{
private var mnu : Menu;
private var smnu : Menu;
private var s1 : Submenu;
public static function main()
{
var bs = new MenuSample();
}
public function new()
{
var mng : Manager = new Manager();
mnu = new Menu( ???MyMenu??? );
smnu = new Menu( ???DDMenu??? );
var i1, i2, i3, i4 : Item;
i1 = new Item( ???Item 1??? );
i2 = new Item( ???Item 2??? );
i3 = new Item( ???--??? );
i4 = new Item( ???Item 3??? );
smnu.addItem( i1 );
smnu.addItem( i2 );
smnu.addItem( i3 );
smnu.addItem( i4 );
i1.onClick = function()
{
neko.Lib.println( ???item 1 was clicked??? );
}
i2.


Pages:
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924