Esempio n. 1
0
        public Dialog(Drawable drawable, VariableSet variables = null)
            : base("CountTool", variables)
        {
            var hbox = new HBox(false, 12) {BorderWidth = 12};
              VBox.PackStart(hbox, true, true, 0);

              var preview = new Preview(drawable, _coordinates);
              hbox.PackStart(preview, true, true, 0);

              var sw = new ScrolledWindow();
              hbox.Add(sw);

              var store = new TreeStore(typeof(Coordinate<int>));
              for (int i = 0; i < 10; i++)
            {
              var coordinate = new Coordinate<int>(10 * i, 10 * i);
              _coordinates.Add(coordinate);
              store.AppendValues(coordinate);
            }

              var view = new TreeView(store);
              sw.Add(view);

              var textRenderer = new CellRendererText();
              view.AppendColumn("X", textRenderer, new TreeCellDataFunc(RenderX));
              view.AppendColumn("Y", textRenderer, new TreeCellDataFunc(RenderY));
        }
Esempio n. 2
0
        public Dialog(Drawable drawable, VariableSet variables = null) :
            base("CountTool", variables)
        {
            var hbox = new HBox(false, 12)
            {
                BorderWidth = 12
            };

            VBox.PackStart(hbox, true, true, 0);

            var preview = new Preview(drawable, _coordinates);

            hbox.PackStart(preview, true, true, 0);

            var sw = new ScrolledWindow();

            hbox.Add(sw);

            var store = new TreeStore(typeof(Coordinate <int>));

            for (int i = 0; i < 10; i++)
            {
                var coordinate = new Coordinate <int>(10 * i, 10 * i);
                _coordinates.Add(coordinate);
                store.AppendValues(coordinate);
            }

            var view = new TreeView(store);

            sw.Add(view);

            var textRenderer = new CellRendererText();

            view.AppendColumn("X", textRenderer, new TreeCellDataFunc(RenderX));
            view.AppendColumn("Y", textRenderer, new TreeCellDataFunc(RenderY));
        }