Esempio n. 1
0
        public MainWindow(string[] files) : base(Gtk.WindowType.Toplevel)
        {
            Build();

            this.files   = new RobotFile[Constants.MAX_ROBOTS];
            robotlist    = new RobotWidget[Constants.MAX_ROBOTS];
            robotactions = new RobotActions[Constants.MAX_ROBOTS];

            // FIXME: Have to wait until MonoDevelop 2.0 for UIManager integration, it seems.
            uimanager = new Gtk.UIManager();

            basicactions = new BasicActions();
            uimanager.InsertActionGroup(basicactions, -1);
            for (int i = 1; i <= Constants.MAX_ROBOTS; i++)
            {
                robotactions[i - 1] = new RobotActions(i);
                uimanager.InsertActionGroup(robotactions[i - 1], -1);
            }
            connectActions();

            uimanager.AddUiFromString(basicactions.buildMenuDescription());
            mainvbox.PackStart(uimanager.GetWidget("/Menubar"));

            gametimer = 0;
            reset_game();
            open_robots(files);
        }
Esempio n. 2
0
        public MainWindow(string[] files)
            : base(Gtk.WindowType.Toplevel)
        {
            Build();

            this.files = new RobotFile[Constants.MAX_ROBOTS];
            robotlist = new RobotWidget[Constants.MAX_ROBOTS];
            robotactions = new RobotActions[Constants.MAX_ROBOTS];

            // FIXME: Have to wait until MonoDevelop 2.0 for UIManager integration, it seems.
            uimanager = new Gtk.UIManager();

            basicactions = new BasicActions();
            uimanager.InsertActionGroup(basicactions, -1);
            for (int i = 1; i <= Constants.MAX_ROBOTS; i++)
            {
                robotactions[i-1] = new RobotActions(i);
                uimanager.InsertActionGroup(robotactions[i-1], -1);
            }
            connectActions();

            uimanager.AddUiFromString(basicactions.buildMenuDescription());
            mainvbox.PackStart(uimanager.GetWidget("/Menubar"));

            gametimer = 0;
            reset_game();
            open_robots(files);
        }