Main() public static method

public static Main ( string args ) : void
args string
return void
Esempio n. 1
0
        static void Main(String[] args)
        {
            Actor      actor;
            Stage      stage;
            Canvas     canvas;
            Transition transition;

            if (Application.Init() != InitError.Success)
            {
                return;
            }

            stage                 = new Stage();
            stage.Title           = "Rectangle with rounded corners";
            stage.BackgroundColor = Clutter.Color.New(255, 255, 255, 255);
            stage.SetSize(500, 500);
            stage.Show();

            canvas = (Canvas)Canvas.New();
            canvas.SetSize(300, 300);

            actor                = new Actor();
            actor.Content        = canvas;
            actor.ContentGravity = ContentGravity.Center;
            actor.SetContentScalingFilters(ScalingFilter.Trilinear, ScalingFilter.Linear);
            actor.SetPivotPoint(0.5f, 0.5f);
            actor.AddConstraint(new BindConstraint(stage, BindCoordinate.Size, 0f));
            stage.AddChild(actor);

            transition                         = new PropertyTransition("rotation-angle-y");
            transition.FromValue               = new GLib.Value(0.0);
            transition.ToValue                 = new GLib.Value(360.0);
            ((Timeline)transition).Duration    = 2000;
            ((Timeline)transition).RepeatCount = -1;
            actor.AddTransition("rotateActor", transition);

            stage.Destroyed += (sender, e) => Application.MainQuit();
            canvas.Drawn    += DrawContent;

            canvas.Invalidate();
            Application.Main();
        }
Esempio n. 2
0
        static void Main(String[] args)
        {
            Stage stage;

            if (Application.Init() != InitError.Success)
            {
                return;
            }

            stage                 = new Stage();
            stage.Title           = "Scroll Actor";
            stage.UserResizable   = true;
            stage.BackgroundColor = Clutter.Color.New(255, 255, 255, 255);
            stage.SetSize(500, 500);

            stage.Destroyed  += (sender, e) => Application.MainQuit();
            stage.KeyPressed += OnKeyPress;

            stage.AddChild(CreateScrollActor(stage));

            stage.Show();

            Application.Main();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var app = new Application(args);

            app.Main();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Application.Init();

            Menu fM = new Menu("File");
            CheckableMenuItem nI = fM.AppendCheckableItem("Hello world", true);
            MenuItem          qI = fM.AppendQuitItem();

            Window w = new Window("Hello world", 300, 300, true);
            Button b = new Button("Increment me");

            s = new Slider(0, 100);
            n = new Spinbox(0, 100);
            p = new ProgressBar();
            Checkbox         c  = new Checkbox("Error");
            ColorButton      cb = new ColorButton();
            EditableCombobox m  = new EditableCombobox();

            m.Text = w.Title;
            VBox x = new VBox();

            b.Clicked += (o, e) =>
            {
                val++;
                ApplyValues(val);
            };
            EventHandler <EventArgs> handle = (o, e) =>
            {
                var v = ((INumInput)o).Value;
                ApplyValues(v);
            };

            n.Changed  += handle;
            s.Changed  += handle;
            cb.Changed += (o, e) =>
            {
                w.MessageBox("Color", String.Format("{0} {1} {2} {3}",
                                                    cb.Color.R, cb.Color.G, cb.Color.B, cb.Color.A));
            };
            nI.Clicked += (o, e) =>
            {
                w.MessageBox("result", nI.Checked.ToString());
            };
            w.Closing += (o, e) =>
            {
                w.MessageBox("Bye!", "See you later", c.Checked);
                w.Destroy();
                Application.Quit();
            };

            w.Margins = 5;
            w.Child   = x;

            x.Padding = 5;
            x.Append(b);
            x.Append(s);
            x.Append(n);
            x.Append(p);
            x.Append(c);
            x.Append(cb);
            x.Append(m);
            w.Visible = true;

            Application.Main();
            Application.Finish();
        }
Esempio n. 5
0
 public void MainTest()
 {
     Application.Main();
 }
Esempio n. 6
0
        public void Main_CanRun_NoThrow()
        {
            var uut = new Application();

            Application.Main();
        }
 public void CanGetAgency()
 {
     Application.Main();
 }