本文整理汇总了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();
}
示例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 ("/");
}