public void CreateGui()
        {
            Gtk.Image icn_reload = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Button);
            _reload          = new Gtk.Button(icn_reload);
            _reload.Clicked += OnReload;

            _performer            = new Gtk.Entry(200);
            _title                = new Gtk.Entry(200);
            _title.WidthChars     = 60;
            _performer.WidthChars = 60;
            _subtitle             = new Gtk.Entry(300);
            _subtitle.WidthChars  = 60;
            _composer             = new Gtk.Entry(200);
            _composer.WidthChars  = 60;
            _year            = new Gtk.Entry(20);
            _year.WidthChars = 20;

            _image = new Gtk.Image();
            _image.SetSizeRequest(100, 100);
            _imagefile          = new Gtk.FileChooserButton("Choose image file", Gtk.FileChooserAction.Open);
            _imagefile.FileSet += new EventHandler(EvtImageSet);

            Gtk.Image icn_add_track = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Button);
            _add_track          = new Gtk.Button(icn_add_track);
            _add_track.Clicked += OnAddTrack;

            Gtk.Image icn_del_track = new Gtk.Image(Gtk.Stock.Delete, Gtk.IconSize.Button);
            _del_track          = new Gtk.Button(icn_del_track);
            _del_track.Clicked += OnDelTrack;

            Gtk.Image icn_save = new Gtk.Image(Gtk.Stock.Save, Gtk.IconSize.Button);
            _save          = new Gtk.Button(icn_save);
            _save.Clicked += OnSave;

            _store  = new Gtk.ListStore(typeof(int), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
            _tracks = new Gtk.TreeView();
            {
                Gtk.CellRendererText cr0 = new Gtk.CellRendererText();
                cr0.Scale = 0.8;
                _tracks.AppendColumn("Nr.", cr0, "text", 0);

                Gtk.CellRendererText cr_title = new Gtk.CellRendererText();
                cr_title.Scale    = 0.8;
                cr_title.Editable = true;
                cr_title.Edited  += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) {
                    setCell(1, args.NewText, new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn("Title", cr_title, "text", 1);

                Gtk.CellRendererText cr_artist = new Gtk.CellRendererText();
                cr_artist.Editable = true;
                cr_artist.Scale    = 0.8;
                cr_artist.Edited  += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) {
                    setCell(2, args.NewText, new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn("Artist", cr_artist, "text", 2);

                Gtk.CellRendererText cr_composer = new Gtk.CellRendererText();
                cr_composer.Editable = true;
                cr_composer.Scale    = 0.8;
                cr_composer.Edited  += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) {
                    setCell(3, args.NewText, new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn("Composer", cr_composer, "text", 3);

                Gtk.CellRendererText cr_piece = new Gtk.CellRendererText();
                cr_piece.Editable = true;
                cr_piece.Scale    = 0.8;
                cr_piece.Edited  += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) {
                    setCell(4, args.NewText, new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn("Piece", cr_piece, "text", 4);

                Gtk.CellRendererText cr_time = new Gtk.CellRendererText();
                cr_time.Editable = true;
                cr_time.Scale    = 0.8;
                cr_time.Edited  += new Gtk.EditedHandler(delegate(object sender, Gtk.EditedArgs args) {
                    setCell(5, args.NewText, new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn("Offset", cr_time, "text", 5);
            }

            _tracks.Model = _store;

            Gtk.Table tbl = new Gtk.Table(2, 5, false);
            tbl.Attach(new Gtk.Label("Album:"), 0, 1, 0, 1);
            tbl.Attach(_title, 1, 2, 0, 1);
            tbl.Attach(new Gtk.Label("Artist:"), 0, 1, 1, 2);
            tbl.Attach(_performer, 1, 2, 1, 2);
            tbl.Attach(new Gtk.Label("Composer:"), 0, 1, 2, 3);
            tbl.Attach(_composer, 1, 2, 2, 3);
            tbl.Attach(new Gtk.Label("Subtitle:"), 0, 1, 3, 4);
            tbl.Attach(_subtitle, 1, 2, 3, 4);
            tbl.Attach(new Gtk.Label("year:"), 0, 1, 4, 5);
            tbl.Attach(_year, 1, 2, 4, 5);

            Gtk.Frame frm = new Gtk.Frame();
            frm.Add(tbl);

            Gtk.HBox hb2 = new Gtk.HBox();
            hb2.PackEnd(_reload, false, false, 1);
            hb2.PackEnd(_del_track, false, false, 1);
            hb2.PackEnd(_add_track, false, false, 1);
            hb2.PackEnd(_save, false, false, 1);

            Gtk.HBox hb  = new Gtk.HBox();
            Gtk.VBox vb1 = new Gtk.VBox();
            vb1.PackStart(frm, false, false, 0);
            vb1.PackStart(hb2, true, true, 0);
            hb.PackStart(vb1, false, false, 0);

            Gtk.Frame frm2 = new Gtk.Frame();
            frm2.Add(_image);
            Gtk.VBox vbi = new Gtk.VBox();
            Gtk.HBox bb  = new Gtk.HBox();
            bb.PackStart(new Gtk.VBox(), true, true, 0);
            bb.PackStart(frm2, false, false, 0);
            bb.PackEnd(new Gtk.VBox(), true, true, 0);

            vbi.PackStart(bb, true, true, 2);
            vbi.PackEnd(_imagefile, false, false, 2);
            hb.PackEnd(vbi, true, true, 2);

            Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow();
            scroll.Add(_tracks);
            scroll.SetSizeRequest(800, 300);

            base.VBox.PackStart(hb, false, false, 4);
            base.VBox.PackStart(scroll, true, true, 0);
            base.VBox.ShowAll();

            base.AddButton("Close", 0);
        }
        private void BuildTools()
        {
            var hbBoxTree = new Gtk.HBox(false, 5);                     //hbox treeview
            var hbBoxForm = new Gtk.HBox(false, 5);                     //hbox para Campos
            var vbPeso    = new Gtk.VBox(false, 5);
            var vbCadera  = new Gtk.VBox(false, 5);
            var hbBox2    = new Gtk.HBox(false, 5);
            var vbBoxBut  = new Gtk.VBox(false, 5);                //Instanciamos una sección VBox de GTK

            tree = new Gtk.TreeView();
            tree.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnRight());

            Gtk.TreeViewColumn pesoColumn = new Gtk.TreeViewColumn();
            pesoColumn.Title = "Peso";
            Gtk.TreeViewColumn caderaColumn = new Gtk.TreeViewColumn();
            caderaColumn.Title = "Cadera";
            Gtk.TreeViewColumn fechaColumn = new Gtk.TreeViewColumn();
            fechaColumn.Title = "Fecha";

            tree.AppendColumn(pesoColumn);
            tree.AppendColumn(caderaColumn);
            tree.AppendColumn(fechaColumn);

            modelMedidas = new Gtk.ListStore(typeof(string), typeof(string), typeof(string));

            tree.Model = modelMedidas;

            Gtk.CellRendererText pesoNameCell = new Gtk.CellRendererText();
            pesoColumn.PackStart(pesoNameCell, true);

            Gtk.CellRendererText caderaNameCell = new Gtk.CellRendererText();
            caderaColumn.PackStart(caderaNameCell, true);

            Gtk.CellRendererText fechaNameCell = new Gtk.CellRendererText();
            fechaColumn.PackStart(fechaNameCell, true);

            pesoColumn.AddAttribute(pesoNameCell, "text", 0);
            caderaColumn.AddAttribute(caderaNameCell, "text", 1);
            fechaColumn.AddAttribute(fechaNameCell, "text", 2);

            pesoNameCell.Editable   = true;
            pesoNameCell.Edited    += PesoNameCell_Edited;
            caderaNameCell.Editable = true;
            caderaNameCell.Edited  += CaderaNameCell_Edited;

            vbPeso.Add(new Gtk.Label("Peso:"));
            entryPeso = new Gtk.Entry();
            vbPeso.Add(entryPeso);

            vbCadera.Add(new Gtk.Label("Cadera"));
            entryCadera = new Gtk.Entry();
            vbCadera.Add(entryCadera);

            hbBoxForm.PackStart(vbPeso, false, false, 5);
            hbBoxForm.PackStart(vbCadera, false, false, 5);

            var btNewMedidas = new Gtk.Button("Crear");

            btNewMedidas.Clicked += (sender, e) => this.OnCreate();

            // Packing everything
            scroll = new Gtk.ScrolledWindow();
            scroll.Add(tree);
            scroll.SetSizeRequest(200, 200);

            vbBoxBut.PackStart(btNewMedidas, false, false, 5);
            hbBox2.PackStart(vbBoxBut, false, false, 5);
            this.vbMain.PackStart(scroll, true, true, 5);
            this.vbMain.PackStart(hbBoxForm, true, true, 5);
            this.vbMain.PackStart(hbBox2, true, true, 5);

            OnInit();
        }
        public void CreateGui()
        {
            Gtk.Image icn_reload=new Gtk.Image(Gtk.Stock.Refresh,Gtk.IconSize.Button);
            _reload=new Gtk.Button(icn_reload);
            _reload.Clicked+=OnReload;

            _performer=new Gtk.Entry(200);
            _title=new Gtk.Entry(200);
            _title.WidthChars=60;
            _performer.WidthChars=60;
            _subtitle=new Gtk.Entry(300);
            _subtitle.WidthChars=60;
            _composer=new Gtk.Entry(200);
            _composer.WidthChars=60;
            _year=new Gtk.Entry(20);
            _year.WidthChars=20;

            _image=new Gtk.Image();
            _image.SetSizeRequest (100,100);
            _imagefile=new Gtk.FileChooserButton("Choose image file",Gtk.FileChooserAction.Open);
            _imagefile.FileSet+=new EventHandler(EvtImageSet);

            Gtk.Image icn_add_track=new Gtk.Image(Gtk.Stock.Add,Gtk.IconSize.Button);
            _add_track=new Gtk.Button(icn_add_track);
            _add_track.Clicked+=OnAddTrack;

            Gtk.Image icn_del_track=new Gtk.Image(Gtk.Stock.Delete,Gtk.IconSize.Button);
            _del_track=new Gtk.Button(icn_del_track);
            _del_track.Clicked+=OnDelTrack;

            Gtk.Image icn_save=new Gtk.Image(Gtk.Stock.Save,Gtk.IconSize.Button);
            _save=new Gtk.Button(icn_save);
            _save.Clicked+=OnSave;

            _store=new Gtk.ListStore(typeof(int),typeof(string),typeof(string),typeof(string),typeof(string),typeof(string));
            _tracks=new Gtk.TreeView();
            {
                Gtk.CellRendererText cr0=new Gtk.CellRendererText();
                cr0.Scale=0.8;
                _tracks.AppendColumn ("Nr.", cr0, "text", 0);

                Gtk.CellRendererText cr_title=new Gtk.CellRendererText();
                cr_title.Scale=0.8;
                cr_title.Editable=true;
                cr_title.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(1,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Title", cr_title, "text", 1);

                Gtk.CellRendererText cr_artist=new Gtk.CellRendererText();
                cr_artist.Editable=true;
                cr_artist.Scale=0.8;
                cr_artist.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(2,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Artist", cr_artist, "text", 2);

                Gtk.CellRendererText cr_composer=new Gtk.CellRendererText();
                cr_composer.Editable=true;
                cr_composer.Scale=0.8;
                cr_composer.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(3,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Composer", cr_composer, "text", 3);

                Gtk.CellRendererText cr_piece=new Gtk.CellRendererText();
                cr_piece.Editable=true;
                cr_piece.Scale=0.8;
                cr_piece.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell(4,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Piece", cr_piece, "text", 4);

                Gtk.CellRendererText cr_time=new Gtk.CellRendererText();
                cr_time.Editable=true;
                cr_time.Scale=0.8;
                cr_time.Edited+=new Gtk.EditedHandler(delegate(object sender,Gtk.EditedArgs args) {
                    setCell (5,args.NewText,new Gtk.TreePath(args.Path));
                });
                _tracks.AppendColumn ("Offset", cr_time, "text", 5);
            }

            _tracks.Model = _store;

            Gtk.Table tbl=new Gtk.Table(2,5,false);
            tbl.Attach (new Gtk.Label("Album:"),0,1,0,1);
            tbl.Attach (_title,1,2,0,1);
            tbl.Attach (new Gtk.Label("Artist:"),0,1,1,2);
            tbl.Attach (_performer,1,2,1,2);
            tbl.Attach (new Gtk.Label("Composer:"),0,1,2,3);
            tbl.Attach (_composer,1,2,2,3);
            tbl.Attach (new Gtk.Label("Subtitle:"),0,1,3,4);
            tbl.Attach (_subtitle,1,2,3,4);
            tbl.Attach (new Gtk.Label("year:"),0,1,4,5);
            tbl.Attach (_year,1,2,4,5);

            Gtk.Frame frm=new Gtk.Frame();
            frm.Add (tbl);

            Gtk.HBox hb2=new Gtk.HBox();
            hb2.PackEnd (_reload,false,false,1);
            hb2.PackEnd (_del_track,false,false,1);
            hb2.PackEnd (_add_track,false,false,1);
            hb2.PackEnd (_save,false,false,1);

            Gtk.HBox hb=new Gtk.HBox();
            Gtk.VBox vb1=new Gtk.VBox();
            vb1.PackStart (frm,false,false,0);
            vb1.PackStart (hb2,true,true,0);
            hb.PackStart (vb1,false,false,0);

            Gtk.Frame frm2=new Gtk.Frame();
            frm2.Add (_image);
            Gtk.VBox vbi=new Gtk.VBox();
            Gtk.HBox bb=new Gtk.HBox();
            bb.PackStart(new Gtk.VBox(),true,true,0);
            bb.PackStart(frm2,false,false,0);
            bb.PackEnd (new Gtk.VBox(),true,true,0);

            vbi.PackStart (bb,true,true,2);
            vbi.PackEnd (_imagefile,false,false,2);
            hb.PackEnd (vbi,true,true,2);

            Gtk.ScrolledWindow scroll=new Gtk.ScrolledWindow();
            scroll.Add (_tracks);
            scroll.SetSizeRequest (800,300);

            base.VBox.PackStart(hb,false,false,4);
            base.VBox.PackStart(scroll,true,true,0);
            base.VBox.ShowAll ();

            base.AddButton ("Close",0);
        }
        public DocumentationDialog(Documentation _doc)
        {
            ContentArea.PackStart(VBox, true, true, 0);

            documentation = _doc;

            Gtk.Label nameLabel = new Gtk.Label("<b>" + documentation.Name + "</b>");
            nameLabel.Wrap         = true;
            nameLabel.UseUnderline = false;
            nameLabel.UseMarkup    = true;
            nameLabel.Xalign       = 0.5f;
            VBox.PackStart(nameLabel, false, false, 10);

            string desc = documentation.Description;

            if (desc == null)
            {
                desc = "";
            }

            var subidEntries = documentation.Keys;

            Gtk.Label descLabel = new Gtk.Label(desc);
            descLabel.Wrap          = true;
            descLabel.UseUnderline  = false;
            descLabel.Xalign        = 0;
            descLabel.WidthChars    = 50;
            descLabel.MaxWidthChars = 50;
            VBox.PackStart(descLabel, false, false, 0);


            // Create SubID table
            if (subidEntries.Count > 0)
            {
                Gtk.Label valuesLabel = new Gtk.Label("\nValues:");
                valuesLabel.UseUnderline = false;
                valuesLabel.Xalign       = 0;
                VBox.PackStart(valuesLabel, false, false, 0);

                Gtk.Table subidTable = new Gtk.Table(2, (uint)subidEntries.Count * 2, false);

                uint subidX = 0;
                uint subidY = 0;

                foreach (string key in subidEntries)
                {
                    string value = documentation.GetField(key);

                    Gtk.Label l1 = new Gtk.Label(key);
                    l1.UseUnderline = false;
                    l1.Xalign       = 0;
                    l1.Yalign       = 0;

                    Gtk.Label l2 = new Gtk.Label(value);
                    l2.UseUnderline  = false;
                    l2.Wrap          = true;
                    l2.Xalign        = 0;
                    l2.Yalign        = 0;
                    l2.WidthChars    = 50;
                    l2.MaxWidthChars = 50;

                    subidTable.Attach(l1, subidX + 0, subidX + 1, subidY, subidY + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 4, 0);
                    subidTable.Attach(l2, subidX + 2, subidX + 3, subidY, subidY + 1);

                    subidY++;
                    subidTable.Attach(new Gtk.HSeparator(), subidX + 0, subidX + 3, subidY, subidY + 1, Gtk.AttachOptions.Fill, 0, 0, 0);
                    subidY++;
                }
                subidTable.Attach(new Gtk.VSeparator(), subidX + 1, subidX + 2, 0, subidTable.NRows, 0, Gtk.AttachOptions.Fill, 4, 0);

                Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow();
                scrolledWindow.AddWithViewport(subidTable);
                scrolledWindow.ShadowType = Gtk.ShadowType.EtchedIn;
                scrolledWindow.SetPolicy(Gtk.PolicyType.Never, Gtk.PolicyType.Automatic);
                subidTable.ShowAll();

                // Determine width/height to request on scrolledWindow
                Gtk.Requisition subidTableRequest = subidTable.SizeRequest();
                int             width             = Math.Min(subidTableRequest.Width + 20, 700);
                width = Math.Max(width, 400);
                int height = Math.Min(subidTableRequest.Height + 5, 400);
                height = Math.Max(height, 200);
                scrolledWindow.SetSizeRequest(width, height);

                VBox.PackStart(scrolledWindow, true, true, 0);
            }

            AddActionWidget(new Gtk.Button("gtk-ok"), 0);

            ShowAll();
        }