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


C# TreeView.ShowAll方法代码示例

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


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

示例1: InitListView

		/// <summary>
		/// Init ListView widget.
		/// </summary>
		private void InitListView(ref ListStore lStore, 
			                      ref TreeView tvObject, 
			                          string[] tvColumns)
		{
			TreeViewColumn tvColumn = null;
			CellRendererText tvCell = null;
			
			tvObject.Selection.Mode = SelectionMode.Multiple;
			System.Type[] lsParam = new System.Type[tvColumns.Length];
			
			// Add Columns to TreeView
			for (int j=0; j<tvColumns.Length; j++)
			{
				tvColumn = new Gtk.TreeViewColumn();		
				tvColumn.MinWidth = 150 ;
				tvColumn.Title = tvColumns[j];
				tvColumn.Resizable = true;
				
				tvCell = new Gtk.CellRendererText();
				tvColumn.PackStart(tvCell, true);
				tvColumn.AddAttribute(tvCell, "text", j);
				
				tvObject.RulesHint = true;
				tvObject.AppendColumn(tvColumn);				
				lsParam[j] = typeof(string);
			}
		
		
			lStore = new Gtk.ListStore(lsParam);
			tvObject.Model = lStore;
			tvObject.ShowAll();
		}
开发者ID:cyberthrone,项目名称:monosim,代码行数:35,代码来源:MainWindowClass.Designer.cs

示例2: UserBrowserPage

        public UserBrowserPage()
        {
            // Create the files tree
            filesList = new TreeView();
            filesList.RowActivated += on_filesList_row_activated;
            filesList.ButtonPressEvent += filesList_ButtonPressEvent;

            // Create the navigation bar
            Alignment navigationBarAlignment = new Alignment(0, 0, 1, 1);
            navigationBarAlignment.TopPadding = 3;
            navigationBarAlignment.BottomPadding = 3;
            navigationBar = new NavigationBar ();
            navigationBar.PathButtonClicked += on_navigationBar_PathButtonClicked;
            navigationBarAlignment.Add(navigationBar);
            base.PackStart(navigationBarAlignment, false, false, 0);
            navigationBarAlignment.ShowAll ();

            // Load some images
            stockDirectoryPixbuf = Gui.LoadIcon(16, "folder");
            stockFilePixbuf      = Gui.LoadIcon(16, "text-x-generic");
            networkIcon          = Gui.LoadIcon(16, "stock_internet");

            // Set up the file list
            filesList.Selection.Changed += filesList_Selection_Changed;
            filesList.Selection.Mode = SelectionMode.Browse;
            /*
            filesList.Selection.Mode = SelectionMode.Multiple;
            filesList.RubberBanding = true;
            */

            filesListStore = new ListStore (typeof(IDirectoryItem));
            filesList.Model = filesListStore;

            TreeViewColumn column;

            // Add Name column
            column = new TreeViewColumn ();
            column.Title = "Name";
            column.Resizable = true;

            Gtk.CellRendererPixbuf fileListRowIcon = new Gtk.CellRendererPixbuf();
            column.PackStart (fileListRowIcon, false);
            column.SetCellDataFunc (fileListRowIcon, new TreeCellDataFunc(FileNameIconFunc));

            Gtk.CellRendererText fileListRowText = new Gtk.CellRendererText();
            column.PackStart (fileListRowText, true);
            column.SetCellDataFunc (fileListRowText, new TreeCellDataFunc(FileNameTextFunc));

            filesList.AppendColumn (column);

            // Add Size Column
            column = filesList.AppendColumn ("Size", new CellRendererText(), new TreeCellDataFunc (FileSizeFunc));
               	column.Resizable = true;

            // Add Type Column
            column = filesList.AppendColumn ("Type", new CellRendererText(), new TreeCellDataFunc (FileTypeFunc));
            column.Resizable = true;

            // Add InfoHash Column
            column = filesList.AppendColumn ("Info Hash", new CellRendererText(), new TreeCellDataFunc (FileInfoHashFunc));
            column.Resizable = true;

            base.PackStart(Gui.AddScrolledWindow(filesList), true, true, 0);
            filesList.ShowAll();

            waitingBoxAlignment = new Alignment(0.5f, 0.5f, 0, 0);
            VBox waitingBox = new VBox();
            waitProgressBar = new ProgressBar();
            waitLabel = new Label();
            waitingBox.PackStart(waitProgressBar, false, false, 0);
            waitingBox.PackStart(waitLabel, false, false, 0);
            waitingBoxAlignment.Add(waitingBox);
            this.PackStart(waitingBoxAlignment, true, true, 0);

            Core.NetworkAdded += Core_NetworkAdded;
            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            resultPopupMenu = new Menu();

            ImageMenuItem item = new ImageMenuItem("Download");
            item.Image = new Image(Gui.LoadIcon(16, "go-down"));
            item.Activated += on_mnuFileDownload_activate;
            resultPopupMenu.Append(item);

            item = new ImageMenuItem(Gtk.Stock.Properties, null);
            item.Activated += filePropertiesMenuItem_Activated;
            resultPopupMenu.Append(item);

            NavigateTo ("/");
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:92,代码来源:UserBrowserPage.cs


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