当前位置: 首页>>代码示例>>C#>>正文


C# TreeView.AppendColumn方法代码示例

本文整理汇总了C#中Gtk.TreeView.AppendColumn方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.AppendColumn方法的具体用法?C# TreeView.AppendColumn怎么用?C# TreeView.AppendColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.TreeView的用法示例。


在下文中一共展示了TreeView.AppendColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Dialog

        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));
        }
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:27,代码来源:Dialog.cs

示例2: ErrorsSource

        public ErrorsSource(string name, Source source)
            : base(name, 50)
        {
            this.source = source;
            this.source.AddChildSource (this);

            scrolled_window = new ScrolledWindow();
            scrolled_window.ShadowType = ShadowType.In;
            scrolled_window.VscrollbarPolicy = PolicyType.Automatic;
            scrolled_window.HscrollbarPolicy = PolicyType.Automatic;

            view = new TreeView();

            scrolled_window.Add(view);
            scrolled_window.ShowAll();

            TreeViewColumn message_col = view.AppendColumn(Catalog.GetString("Message"),
                new CellRendererText(), "text", 0);
            TreeViewColumn file_col = view.AppendColumn(Catalog.GetString("File Name"),
                new CellRendererText(), "text", 1);

            message_col.Resizable = true;
            file_col.Resizable = true;

            store = new ListStore(typeof(string), typeof(string), typeof(Exception));
            view.Model = store;
        }
开发者ID:jrmuizel,项目名称:banshee-unofficial-plugins,代码行数:27,代码来源:ErrorsSource.cs

示例3: Main20

		public static void Main20 (string[] args)
		{
			Application.Init ();

			PopulateStore ();

			Window win = new Window ("TreeView demo");
			win.DeleteEvent += new DeleteEventHandler (DeleteCB);
			win.DefaultWidth = 320;
			win.DefaultHeight = 480;

			ScrolledWindow sw = new ScrolledWindow ();
			win.Add (sw);

			TreeView tv = new TreeView (store);
			tv.HeadersVisible = true;

			tv.AppendColumn ("One", new CellRendererText (), new TreeCellDataFunc (CellDataA));
			tv.AppendColumn ("Two", new CellRendererText (), new TreeCellDataFunc (CellDataB));

			sw.Add (tv);
			win.ShowAll ();

			Application.Run ();
		}
开发者ID:akrisiun,项目名称:gtk-sharp,代码行数:25,代码来源:ManagedTreeViewDemo.cs

示例4: MultiChooserDialog

        public MultiChooserDialog(IList options, IList banned)
        {
            base.Modal = true;
            base.HeightRequest = 400;
            base.WidthRequest = 250;
            //TODO: i18n
            base.Title = GettextCatalog.GetString ("Choose elements");
            base.AddButton(GettextCatalog.GetString ("_Cancel"), Gtk.ResponseType.Cancel);
            base.AddButton(GettextCatalog.GetString ("_Accept"), Gtk.ResponseType.Accept);
            base.Response += new Gtk.ResponseHandler(OnResponse);

            TreeView treeView = new TreeView();
            treeView.HeadersVisible = false;
            _store = new ListStore(typeof(bool), typeof(string));
            treeView.Model = _store;
            CellRendererToggle crtgl = new CellRendererToggle();
            crtgl.Activatable = true;
            crtgl.Toggled += new ToggledHandler(CheckboxToggledHandler);
            TreeViewColumn column = new TreeViewColumn ();
            column.PackStart(crtgl, false);
            column.AddAttribute(crtgl, "active", 0);
            treeView.AppendColumn(column);
            CellRendererText crtxt = new CellRendererText ();
            column = new TreeViewColumn ();
            column.PackStart(crtxt, false);
            column.AddAttribute(crtxt, "text", 1);
            treeView.AppendColumn(column);
            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Add(treeView);
            treeView.Show();
            base.VBox.Add(sw);
            ShowList(options, banned);
            sw.Show();
        }
开发者ID:MonoBrasil,项目名称:historico,代码行数:35,代码来源:MultiChooserDialog.cs

示例5: BookmarkOutput

        public BookmarkOutput()
        {
            this.ShadowType = ShadowType.Out;
            treeView = new TreeView();
            treeView.Selection.Mode = Gtk.SelectionMode.Single;

            treeView.Model = outputModel;

            FontDescription customFont =  Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            treeView.ModifyFont(customFont);

            TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Line"),  new CellRendererText(), "text", 1);
            tvcState.MinWidth = 25;
            treeView.AppendColumn(tvcState);

            TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("file"),  new CellRendererText(), "text", 0);
            tvcName.MinWidth = 100;
            treeView.AppendColumn(tvcName);

            TreeViewColumn tvcText = new TreeViewColumn (MainClass.Languages.Translate("name"),  new CellRendererText(), "text", 2);
            tvcText.MinWidth = 100;
            treeView.AppendColumn(tvcText);

            treeView.HeadersVisible = true;
            treeView.EnableTreeLines = true;

            treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
            treeView.EnableSearch =false;
            treeView.HasFocus = false;

            this.Add(treeView);

            this.ShowAll();
        }
开发者ID:moscrif,项目名称:ide,代码行数:34,代码来源:BookmarkOutput.cs

示例6: EnvVarList

		public EnvVarList()
		{
			list = new TreeView ();
			store = new ListStore (typeof(string), typeof(string), typeof(bool), typeof(string));
			list.Model = store;
			Add (list);
			
			CellRendererText crt = new CellRendererText ();
			crt.Editable = true;
			TreeViewColumn col = list.AppendColumn (GettextCatalog.GetString ("Variable"), crt, "text", 0, "foreground", 3);
			col.Resizable = true;
			
			CellRendererText crv = new CellRendererText ();
			col = list.AppendColumn (GettextCatalog.GetString ("Value"), crv, "text", 1, "editable", 2);
			col.Resizable = true;
			
			crt.Edited += OnExpEdited;
			crt.EditingStarted += OnExpEditing;
			crv.Edited += OnValEdited;
			
			createMsg = GettextCatalog.GetString ("Click here to add a new variable");
			AppendInserter ();
			
			ShowAll ();
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:25,代码来源:EnvVarList.cs

示例7: ImageInfo

	public ImageInfo () : base (null, null)
	{
		store = new TreeStore ((int)TypeFundamentals.TypeString,
				       (int)TypeFundamentals.TypeString);
		
		tv = new TreeView (store);
		tv.HeadersVisible = true;

		TreeViewColumn NameCol = new TreeViewColumn ();
		CellRenderer NameRenderer = new CellRendererText ();

		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		tv.AppendColumn (NameCol);

		TreeViewColumn ValueCol = new TreeViewColumn ();
		CellRenderer ValueRenderer = new CellRendererText ();
		ValueCol.Title = "Value";
		ValueCol.PackStart (ValueRenderer, false);
		ValueCol.AddAttribute (ValueRenderer, "text", 1);
		tv.AppendColumn (ValueCol);

		//
		// Populate tree
		//

		TreeIter iter = new TreeIter ();
		PopulateGeneral (out iter);
		PopulateDetails (out iter);
		Add (tv);
	}
开发者ID:emtees,项目名称:old-code,代码行数:32,代码来源:ImageInfo.cs

示例8: AppendColumns

        public void AppendColumns(TreeView treeView, IDataReader dataReader)
        {
            for (int index = 0; index < dataReader.FieldCount; index++)
            {
                //Console.WriteLine("el indice es: {0}", index);
                treeView.AppendColumn (dataReader.GetName (index), new CellRendererText(), "text", index);

                //treeView.AppendColumn ("columna1", new CellRendererText(), "text",index);
            }

            //Añadimos la columna de la cantidad porque en la BBDD no tenemos este campo.
            TreeViewColumn cantidad = new TreeViewColumn();
            cantidad.Title = "Cantidad";
            CellRendererText cant = new CellRendererText();
            cantidad.PackStart(cant, true);
            cantidad.AddAttribute(cant,"text",4);

            //para mostrar las imágenes
            //CellRendererPixbuf cellRendererPixbuf = new CellRendererPixbuf();

            //prueba para cambiar tamaño letra
            cantidad.Sizing = TreeViewColumnSizing.Fixed;
               	cantidad.FixedWidth = 200;

            treeView.AppendColumn(cantidad);
        }
开发者ID:JulianaCFS,项目名称:Proyecto,代码行数:26,代码来源:TreeViewExtension.cs

示例9: TableMappingWidget

		public TableMappingWidget (bool showCheckBoxes)
		{
			store = new ListStore (typeof (bool), typeof (TableContainer));
			list = new TreeView (store);
			
			TreeViewColumn colName = new TreeViewColumn ();
			colName.Title = AddinCatalog.GetString ("Name");

			CellRendererToggle toggleRenderer = new CellRendererToggle ();
			toggleRenderer.Activatable = true;
			toggleRenderer.Toggled += new ToggledHandler (SelectToggled);
			colName.PackStart (toggleRenderer, false);
			CellRendererText nameRenderer = new CellRendererText ();
			colName.PackStart (nameRenderer, true);

			TreeViewColumn colClassName = new TreeViewColumn ();
			colClassName.Title = AddinCatalog.GetString ("Class Name");
			CellRendererText propNameRenderer = new CellRendererText ();
			propNameRenderer.Editable = true;
			propNameRenderer.Edited += new EditedHandler (ClassNameEdited);
			colClassName.PackStart (propNameRenderer, true);
			
			colName.SetCellDataFunc (nameRenderer, new CellLayoutDataFunc (NameDataFunc));
			colClassName.SetCellDataFunc (propNameRenderer, new CellLayoutDataFunc (ClassNameDataFunc));

			list.AppendColumn (colName);
			list.AppendColumn (colClassName);
			list.HeadersVisible = true;
			
			this.Add (list);
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:31,代码来源:TableMappingWidget.cs

示例10: Run

    public void Run(string[] args)
    {
        Application.Init ();
        PopulateStore ();
        store.SetSortColumnId(2, SortType.Ascending);

        Window win = new Window ("Gtk Widget Attributes");
        win.DeleteEvent += new DeleteEventHandler (DeleteCB);
        win.SetDefaultSize (640,480);

        ScrolledWindow sw = new ScrolledWindow ();
        win.Add (sw);

        TreeView tv = new TreeView (store);
        tv.HeadersVisible = true;

        tv.AppendColumn ("Name", new CellRendererText (), "markup", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        foreach(TreeViewColumn col in tv.Columns)
            col.Resizable = true;

        tv.SearchColumn = 2;

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
开发者ID:langpavel,项目名称:LPS-old,代码行数:33,代码来源:Main.cs

示例11: GacReferencePanel

        public GacReferencePanel(SelectReferenceDialog selectDialog)
        {
            this.selectDialog = selectDialog;

            store = new TreeStore (typeof (string), typeof (string), typeof(string), typeof(bool), typeof(string));
            treeView = new TreeView (store);

            TreeViewColumn firstColumn = new TreeViewColumn ();
            firstColumn.Title = GettextCatalog.GetString ("Reference Name");
            CellRendererToggle tog_render = new CellRendererToggle ();
            tog_render.Toggled += new Gtk.ToggledHandler (AddReference);
            firstColumn.PackStart (tog_render, false);
            firstColumn.AddAttribute (tog_render, "active", 3);

            CellRendererText text_render = new CellRendererText ();
            firstColumn.PackStart (text_render, true);
            firstColumn.AddAttribute (text_render, "text", 0);

            treeView.AppendColumn (firstColumn);
            treeView.AppendColumn (GettextCatalog.GetString ("Version"), new CellRendererText (), "text", 1);
            // FIXME: this seems useless
            //treeView.AppendColumn (GettextCatalog.GetString ("Path"), new CellRendererText (), "text", 2);

            store.SetSortColumnId (0, SortType.Ascending);
            store.SetSortFunc (0, new TreeIterCompareFunc (SortTree));

            PrintCache();
            ScrolledWindow sc = new ScrolledWindow ();
            sc.ShadowType = Gtk.ShadowType.In;
            sc.Add (treeView);
            this.PackStart (sc, true, true, 0);
            ShowAll ();
            BorderWidth = 6;
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:34,代码来源:GacReferencePanel.cs

示例12: TreeViewDemo

    public TreeViewDemo()
    {
        Application.Init ();
        PopulateStore ();

        Window win = new Window ("TreeView demo");
        win.DeleteEvent += new DeleteEventHandler (DeleteCB);
        win.SetDefaultSize (640,480);

        ScrolledWindow sw = new ScrolledWindow ();
        win.Add (sw);

        TreeView tv = new TreeView (store);
        tv.EnableSearch = true;
        tv.HeadersVisible = true;
        tv.HeadersClickable = true;

        tv.AppendColumn ("Name", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
开发者ID:numerodix,项目名称:nametrans,代码行数:29,代码来源:TreeViewDemo.cs

示例13: initChat

    public void initChat()
    {
        Gtk.TreeView chatTree = new Gtk.TreeView ();
        messagesPanel.Add (chatTree);

        Gtk.TreeViewColumn userColumn = new Gtk.TreeViewColumn ();
        userColumn.Title = "User";

        Gtk.CellRendererText userCell = new Gtk.CellRendererText ();
        userColumn.PackStart (userCell, true);

        Gtk.TreeViewColumn messageColumn = new Gtk.TreeViewColumn ();
        messageColumn.Title = "Message";

        Gtk.CellRendererText messageCell = new Gtk.CellRendererText ();
        messageColumn.PackStart (messageCell, true);

        chatTree.AppendColumn (userColumn);
        chatTree.AppendColumn (messageColumn);

        userColumn.AddAttribute (userCell, "text", 0);
        messageColumn.AddAttribute (messageCell, "text", 1);

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

        //messageListStore.AppendValues ("Username", "Hello World");

        chatTree.Model = messagesListStore;
        messagesPanel.ShowAll ();
    }
开发者ID:quzz0,项目名称:HellMessengerL,代码行数:30,代码来源:MainWindow.cs

示例14: Tree

    public Tree(string[] args)
    {
        Application.Init ();

        store = new TreeStore (typeof (string), typeof (string));

        Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null );
        gxml.Autoconnect( this );

        window.Resize(500, 400 );
        // eventos
        window.DeleteEvent += new DeleteEventHandler( Salir );
        b_agregar.Clicked += new EventHandler( Agregar );
        b_eliminar.Clicked += new EventHandler( Borrar );
        b_limpiar.Clicked += new EventHandler( Limpiar );
        b_salir.Clicked += new EventHandler( Cerrar );

        // crear arbol

        tv = new TreeView ();
        tv.Model = store;
        tv.HeadersVisible = true;

        tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1);

        scrolledwindow1.Add (tv);
        window.ShowAll ();
        Application.Run ();
    }
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:30,代码来源:tree.cs

示例15: TSharedFiles

        public TSharedFiles(Gtk.TreeView tv, CInterfaceGateway in_krnGateway)
        {
            tvSharedFiles = tv;
            krnGateway = in_krnGateway;
            store = new TreeStore (typeof (string), typeof (string), typeof (string),
               	                     typeof (string));
               	   tvSharedFiles.Model = store;
            Gtk.TreeViewColumn tvc = new TreeViewColumn ("File name", new CellRendererText(),"text",0);
            tvSharedFiles.AppendColumn (tvc);
            tvc.SortColumnId = 0;

            tvc = new TreeViewColumn ("Size", new CellRendererText(),"text",1);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 1;

               	   tvc = new TreeViewColumn ("Priority", new CellRendererText(),"text",2);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 2;

               	   tvc = new TreeViewColumn ("Progress", new CellRendererText(),"text",3);
               	   tvSharedFiles.AppendColumn (tvc);
               	   tvc.SortColumnId = 3;

               	   loadSharedFiles();
               	   //krnGateway.OnNewSharedFile+=new FileEvent(prueba);
        }
开发者ID:sonicwang1989,项目名称:lphant,代码行数:26,代码来源:SharedFiles.cs


注:本文中的Gtk.TreeView.AppendColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。