Esempio n. 1
0
        public ScrollWindowSample()
        {
            ScrollView v1 = new ScrollView();
            VBox       b1 = new VBox();

            for (int n = 0; n < 30; n++)
            {
                b1.PackStart(new Label("Line " + n), BoxMode.None);
            }
            Button u = new Button("Click to remove");

            u.Clicked += delegate {
                b1.Remove(u);
            };
            b1.PackStart(u);

            v1.Content = b1;
            v1.VerticalScrollPolicy = ScrollPolicy.Always;
            v1.BorderVisible        = false;
            PackStart(v1, BoxMode.FillAndExpand);

            ScrollView v2 = new ScrollView();
            VBox       b2 = new VBox();

            for (int n = 0; n < 10; n++)
            {
                b2.PackStart(new Label("Line " + n), BoxMode.None);
            }
            v2.Content = b2;
            v2.VerticalScrollPolicy = ScrollPolicy.Never;
            PackStart(v2, BoxMode.FillAndExpand);

            ScrollView v3 = new ScrollView();
            VBox       b3 = new VBox();
            Button     b  = new Button("Click to add items");

            b.Clicked += delegate {
                for (int n = 0; n < 10; n++)
                {
                    b3.PackStart(new Label("Line " + n), BoxMode.None);
                }
            };
            b3.PackStart(b);
            v3.Content = b3;
            v3.VerticalScrollPolicy = ScrollPolicy.Automatic;
            PackStart(v3, BoxMode.FillAndExpand);

            ScrollView v4 = new ScrollView();

            PackStart(v4, BoxMode.FillAndExpand);
            var sb = new ScrollableCanvas();

            v4.Content = sb;
            v4.VerticalScrollPolicy = ScrollPolicy.Always;
        }
Esempio n. 2
0
        public ScrollWindowSample()
        {
            ScrollView v1 = new ScrollView ();
            VBox b1 = new VBox ();
            for (int n=0; n<30; n++)
                b1.PackStart (new Label ("Line " + n), BoxMode.None);
            Button u = new Button ("Click to remove");
            u.Clicked += delegate {
                b1.Remove (u);
            };
            b1.PackStart (u);

            v1.Content = b1;
            v1.VerticalScrollPolicy = ScrollPolicy.Always;
            v1.BorderVisible = false;
            PackStart (v1, BoxMode.FillAndExpand);

            ScrollView v2 = new ScrollView ();
            VBox b2 = new VBox ();
            for (int n=0; n<10; n++)
                b2.PackStart (new Label ("Line " + n), BoxMode.None);
            v2.Content = b2;
            v2.VerticalScrollPolicy = ScrollPolicy.Never;
            PackStart (v2, BoxMode.FillAndExpand);

            ScrollView v3 = new ScrollView ();
            VBox b3 = new VBox ();
            Button b = new Button ("Click to add items");
            b.Clicked += delegate {
                for (int n=0; n<10; n++)
                    b3.PackStart (new Label ("Line " + n), BoxMode.None);
            };
            b3.PackStart (b);
            v3.Content = b3;
            v3.VerticalScrollPolicy = ScrollPolicy.Automatic;
            PackStart (v3, BoxMode.FillAndExpand);

            ScrollView v4 = new ScrollView ();
            PackStart (v4, BoxMode.FillAndExpand);
            var sb = new ScrollableCanvas ();
            v4.Content = sb;
            v4.VerticalScrollPolicy = ScrollPolicy.Always;
        }