本文整理汇总了C#中Gtk.TreeView.Show方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.Show方法的具体用法?C# TreeView.Show怎么用?C# TreeView.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeView
的用法示例。
在下文中一共展示了TreeView.Show方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: PageView
public PageView () : base ()
{
view = new TreeView ();
view.AppendColumn ("Count", new CellRendererText (), "text", 1);
TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
view.AppendColumn (col);
view.ExpanderColumn = col;
view.Show ();
Add (view);
}
示例3: AllocationsView
public AllocationsView (ProfilerEventHandler data, DisplayOptions options) : base ()
{
TreeView view = new TreeView (new TreeModelAdapter (new AllocationsStore (data, options)));
view.AppendColumn ("Cost", new CellRendererText (), "text", 1);
TreeViewColumn col = new TreeViewColumn ("Class/Allocator", new CellRendererText (), "text", 0);
view.AppendColumn (col);
view.ExpanderColumn = col;
view.Show ();
Add (view);
}
示例4: CallsView
public CallsView (ProfilerEventHandler data, DisplayOptions options) : base ()
{
TreeView view = new TreeView (new TreeModelAdapter (new CallsStore (data, options)));
view.AppendColumn ("Cost", new CellRendererText (), "text", 1);
TreeViewColumn col = new TreeViewColumn ("Method", new CellRendererText (), "text", 0);
view.AppendColumn (col);
view.ExpanderColumn = col;
view.Show ();
options.Changed += delegate { view.Model = new TreeModelAdapter (new CallsStore (data, options)); };
Add (view);
}
示例5: CreateStackTraceTreeView
Widget CreateStackTraceTreeView ()
{
var store = new ListStore (typeof (ExceptionStackFrame), typeof (string), typeof (bool));
StackTraceTreeView = new TreeView (store);
StackTraceTreeView.HeadersVisible = false;
StackTraceTreeView.ShowExpanders = false;
StackTraceTreeView.RulesHint = true;
StackTraceTreeView.Show ();
var ccr = new ExceptionCaughtLineNumberRenderer ();
var crt = new CellRendererText ();
crt.Ellipsize = Pango.EllipsizeMode.End;
crt.WrapWidth = -1;
StackTraceTreeView.AppendColumn ("", ccr, (CellLayoutDataFunc) LineNumberLayout);
StackTraceTreeView.AppendColumn ("", crt, "markup", (int) ModelColumn.Markup);
StackTraceTreeView.SizeAllocated += (o, args) => crt.WrapWidth = args.Allocation.Width;
StackTraceTreeView.RowActivated += StackFrameActivated;
var scrolled = new ScrolledWindow () { HeightRequest = 128 };
scrolled.ShadowType = ShadowType.None;
scrolled.Add (StackTraceTreeView);
scrolled.Show ();
return scrolled;
}
示例6: CreateStackTraceTreeView
Widget CreateStackTraceTreeView ()
{
var store = new ListStore (typeof (ExceptionStackFrame), typeof (string), typeof (bool));
StackTraceTreeView = new TreeView (store);
StackTraceTreeView.SearchColumn = -1; // disable the interactive search
StackTraceTreeView.FixedHeightMode = false;
StackTraceTreeView.HeadersVisible = false;
StackTraceTreeView.ShowExpanders = false;
StackTraceTreeView.RulesHint = false;
StackTraceTreeView.Show ();
var renderer = new StackFrameCellRenderer (StackTraceTreeView.PangoContext);
StackTraceTreeView.AppendColumn ("", renderer, (CellLayoutDataFunc)StackFrameLayout);
StackTraceTreeView.RowActivated += StackFrameActivated;
var scrolled = new ScrolledWindow {
HeightRequest = 180,
HscrollbarPolicy = PolicyType.Never,
VscrollbarPolicy = PolicyType.Automatic
};
scrolled.ShadowType = ShadowType.None;
scrolled.Add (StackTraceTreeView);
scrolled.Show ();
var vbox = new VBox ();
vbox.PackStart (CreateSeparator (), false, true, 0);
vbox.PackStart (scrolled, true, true, 0);
vbox.Show ();
var vbox2 = new VBox ();
expanderStacktrace = WrapInExpander (GettextCatalog.GetString ("Stacktrace"), vbox);
vbox2.PackStart (new VBox (), false, false, 5);
vbox2.PackStart (expanderStacktrace, true, true, 0);
vbox2.ShowAll ();
return vbox2;
}
示例7: SyncDialog
// TODO: Possible to make Tomboy not crash if quit while dialog is up?
public SyncDialog ()
: base (string.Empty,
null,
Gtk.DialogFlags.DestroyWithParent)
{
progressBarTimeoutId = 0;
SetSizeRequest (400, -1);
HasSeparator = false;
// Outer box. Surrounds all of our content.
VBox outerVBox = new VBox (false, 12);
outerVBox.BorderWidth = 6;
outerVBox.Show ();
VBox.PackStart (outerVBox, true, true, 0);
// Top image and label
HBox hbox = new HBox (false, 12);
hbox.Show ();
outerVBox.PackStart (hbox, false, false, 0);
image = new Image (GuiUtils.GetIcon ("tomboy", 48));
image.Xalign = 0;
image.Yalign = 0;
image.Show ();
hbox.PackStart (image, false, false, 0);
// Label header and message
VBox vbox = new VBox (false, 6);
vbox.Show ();
hbox.PackStart (vbox, true, true, 0);
headerLabel = new Label ();
headerLabel.UseMarkup = true;
headerLabel.Xalign = 0;
headerLabel.UseUnderline = false;
headerLabel.LineWrap = true;
headerLabel.Show ();
vbox.PackStart (headerLabel, false, false, 0);
messageLabel = new Label ();
messageLabel.Xalign = 0;
messageLabel.UseUnderline = false;
messageLabel.LineWrap = true;
messageLabel.SetSizeRequest (250, -1);
messageLabel.Show ();
vbox.PackStart (messageLabel, false, false, 0);
progressBar = new Gtk.ProgressBar ();
progressBar.Orientation = Gtk.ProgressBarOrientation.LeftToRight;
progressBar.BarStyle = ProgressBarStyle.Continuous;
progressBar.ActivityBlocks = 30;
progressBar.Show ();
outerVBox.PackStart (progressBar, false, false, 0);
progressLabel = new Label ();
progressLabel.UseMarkup = true;
progressLabel.Xalign = 0;
progressLabel.UseUnderline = false;
progressLabel.LineWrap = true;
progressLabel.Wrap = true;
progressLabel.Show ();
outerVBox.PackStart (progressLabel, false, false, 0);
// Expander containing TreeView
expander = new Gtk.Expander (Catalog.GetString ("Details"));
expander.Spacing = 6;
expander.Activated += OnExpanderActivated;
expander.Show ();
outerVBox.PackStart (expander, true, true, 0);
// Contents of expander
Gtk.VBox expandVBox = new Gtk.VBox ();
expandVBox.Show ();
expander.Add (expandVBox);
// Scrolled window around TreeView
Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow ();
scrolledWindow.ShadowType = Gtk.ShadowType.In;
scrolledWindow.SetSizeRequest (-1, 200);
scrolledWindow.Show ();
expandVBox.PackStart (scrolledWindow, true, true, 0);
// Create model for TreeView
model = new Gtk.TreeStore (typeof (string), typeof (string));
// Create TreeView, attach model
Gtk.TreeView treeView = new Gtk.TreeView ();
treeView.Model = model;
treeView.RowActivated += OnRowActivated;
treeView.Show ();
scrolledWindow.Add (treeView);
// Set up TreeViewColumns
Gtk.TreeViewColumn column = new Gtk.TreeViewColumn (
Catalog.GetString ("Note Title"),
new Gtk.CellRendererText (), "text", 0);
column.SortColumnId = 0;
column.Resizable = true;
//.........这里部分代码省略.........
示例8: CreateStackTraceTreeView
Widget CreateStackTraceTreeView ()
{
var store = new ListStore (typeof (ExceptionStackFrame), typeof (string), typeof (bool));
StackTraceTreeView = new TreeView (store);
StackTraceTreeView.FixedHeightMode = false;
StackTraceTreeView.HeadersVisible = false;
StackTraceTreeView.ShowExpanders = false;
StackTraceTreeView.RulesHint = true;
StackTraceTreeView.Show ();
var renderer = new StackFrameCellRenderer (StackTraceTreeView.PangoContext);
renderer.Width = DefaultWidth;
StackTraceTreeView.AppendColumn ("", renderer, (CellLayoutDataFunc) StackFrameLayout);
StackTraceTreeView.SizeAllocated += (o, args) => renderer.Width = args.Allocation.Width;
StackTraceTreeView.RowActivated += StackFrameActivated;
var scrolled = new ScrolledWindow { HeightRequest = 180, HscrollbarPolicy = PolicyType.Automatic, VscrollbarPolicy = PolicyType.Automatic };
scrolled.ShadowType = ShadowType.None;
scrolled.Add (StackTraceTreeView);
scrolled.Show ();
return scrolled;
}
示例9: AddTreeViewInVBox
private void AddTreeViewInVBox(TreeView tv)
{
// I remove the actual treeview
Widget widgetToRemove = null;
foreach (Widget w in this.vbox1.AllChildren) {
if (w is TreeView) {
widgetToRemove = w;
break;
}
}
widgetToRemove.Hide();
this.vbox1.Remove(widgetToRemove);
// Add and reorder the treeview
this.vbox1.PackStart(tv, true, true, 0);
this.vbox1.ReorderChild(tv, 2);
tv.Show();
}
示例10: MakeGeneralPage
private Gtk.Widget MakeGeneralPage()
{
VBox vbox = new VBox (false, 6);
vbox.BorderWidth = 10;
//
// ITask Management System
//
VBox sectionVBox = new VBox (false, 4);
Label l = new Label ();
l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
Catalog.GetString ("Task Management System"));
l.UseUnderline = false;
l.UseMarkup = true;
l.Wrap = false;
l.Xalign = 0;
l.Show ();
sectionVBox.PackStart (l, false, false, 0);
backendComboBox = ComboBox.NewText ();
backendComboMap = new Dictionary<int, string> ();
// Fill out the ComboBox
int i = 0;
selectedBackend = -1;
foreach (var backend in application.BackendManager.AvailableBackends) {
backendComboBox.AppendText (backend.Value);
backendComboMap [i] = backend.Key;
if (backend.Key == application.BackendManager.CurrentBackend)
selectedBackend = i;
i++;
}
if (selectedBackend >= 0)
backendComboBox.Active = selectedBackend;
backendComboBox.Changed += OnBackendComboBoxChanged;
backendComboBox.Show ();
HBox hbox = new HBox (false, 6);
l = new Label (string.Empty); // spacer
l.Show ();
hbox.PackStart (l, false, false, 0);
hbox.PackStart (backendComboBox, false, false, 0);
hbox.Show ();
sectionVBox.PackStart (hbox, false, false, 0);
sectionVBox.Show ();
vbox.PackStart (sectionVBox, false, false, 0);
//
// ITask Filtering
//
sectionVBox = new VBox (false, 4);
l = new Label ();
l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
Catalog.GetString ("Task Filtering"));
l.UseUnderline = false;
l.UseMarkup = true;
l.Wrap = false;
l.Xalign = 0;
l.Show ();
sectionVBox.PackStart (l, false, false, 0);
HBox sectionHBox = new HBox (false, 6);
l = new Label (string.Empty); // spacer
l.Show ();
sectionHBox.PackStart (l, false, false, 0);
VBox innerSectionVBox = new VBox (false, 6);
hbox = new HBox (false, 6);
bool showCompletedTasks = application.Preferences.GetBool (
PreferencesKeys.ShowCompletedTasksKey);
showCompletedTasksCheckButton =
new CheckButton (Catalog.GetString ("Sh_ow completed tasks"));
showCompletedTasksCheckButton.UseUnderline = true;
showCompletedTasksCheckButton.Active = showCompletedTasks;
showCompletedTasksCheckButton.Show ();
hbox.PackStart (showCompletedTasksCheckButton, true, true, 0);
hbox.Show ();
innerSectionVBox.PackStart (hbox, false, false, 0);
// TaskLists TreeView
l = new Label (Catalog.GetString ("Only _show these lists when \"All\" is selected:"));
l.UseUnderline = true;
l.Xalign = 0;
l.Show ();
innerSectionVBox.PackStart (l, false, false, 0);
ScrolledWindow sw = new ScrolledWindow ();
sw.HscrollbarPolicy = PolicyType.Automatic;
sw.VscrollbarPolicy = PolicyType.Automatic;
sw.ShadowType = ShadowType.EtchedIn;
taskListsTree = new TreeView ();
taskListsTree.Selection.Mode = SelectionMode.None;
taskListsTree.RulesHint = false;
taskListsTree.HeadersVisible = false;
l.MnemonicWidget = taskListsTree;
Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
column.Title = Catalog.GetString ("Task List");
//.........这里部分代码省略.........
示例11: CoverageView
public CoverageView (string fileName, ProgressBar status)
{
TreeStore store = new TreeStore (typeof (string), typeof (string), typeof (string), typeof (string), typeof (object));
tree = new TreeView (store);
CellRendererText renderer = new CellRendererText ();
// LAME: Why is this property a float instead of a double ?
renderer.Xalign = 0.5f;
tree.AppendColumn ("Classes", new CellRendererText (), "text", 0);
tree.AppendColumn ("Lines Hit", renderer, "text", 1);
tree.AppendColumn ("Lines Missed", renderer, "text", 2);
tree.AppendColumn ("Coverage", renderer, "text", 3);
tree.GetColumn (0).Resizable = true;
tree.GetColumn (1).Alignment = 0.0f;
tree.GetColumn (1).Resizable = true;
tree.GetColumn (2).Alignment = 0.0f;
tree.GetColumn (2).Resizable = true;
tree.GetColumn (3).Alignment = 0.0f;
tree.GetColumn (3).Resizable = true;
tree.HeadersVisible = true;
model = new CoverageModel ();
foreach (string filter in DEFAULT_FILTERS) {
model.AddFilter (filter);
}
this.status = status;
model.Progress += Progress;
model.ReadFromFile (fileName);
TreeItem root = new TreeItem (store, null, model, "PROJECT");
Hashtable classes2 = model.Classes;
namespaces = new Hashtable ();
string[] sorted_names = new string [classes2.Count];
classes2.Keys.CopyTo (sorted_names, 0);
Array.Sort (sorted_names);
Progress ("Building tree", 0.95);
foreach (string name in sorted_names) {
ClassCoverageItem klass = (ClassCoverageItem)classes2 [name];
if (klass.filtered)
continue;
string namespace2 = klass.name_space;
TreeItem nsItem = (TreeItem)namespaces [namespace2];
if (nsItem == null) {
nsItem = new TreeItem (store, root, (CoverageItem)model.Namespaces [namespace2], namespace2);
// nsItem.SetPixmap (0, namespaceOpenPixmap);
namespaces [namespace2] = nsItem;
}
if (nsItem.model.filtered)
continue;
ClassItem classItem = new ClassItem (store, nsItem, klass, klass.name);
// We should create the method nodes only when the class item
// is opened
foreach (MethodCoverageItem method in klass.Methods) {
if (method.filtered)
continue;
string title = method.Name;
if (title.Length > 64)
title = title.Substring (0, 63) + "...)";
new MethodItem (store, classItem, classItem, method, title);
}
}
tree.ExpandRow (store.GetPath (root.Iter), false);
// it becomes very hard to navigate if everything is expanded
//foreach (string ns in namespaces.Keys)
// tree.ExpandRow (store.GetPath (((TreeItem)namespaces [ns]).Iter), false);
tree.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
tree.Selection.Mode = SelectionMode.Single;
source_views = new Hashtable ();
window_maps = new Hashtable ();
Progress ("Done", 1.0);
// LAME: Why doesn't widgets visible by default ???
tree.Show ();
}
示例12: MakeAddinsPane
// Page 3
// Extension Preferences
public Gtk.Widget MakeAddinsPane ()
{
Gtk.VBox vbox = new Gtk.VBox (false, 6);
vbox.BorderWidth = 6;
Gtk.Label l = new Gtk.Label (Catalog.GetString (
"The following add-ins are installed"));
l.Xalign = 0;
l.Show ();
vbox.PackStart (l, false, false, 0);
Gtk.HBox hbox = new Gtk.HBox (false, 6);
// TreeView of Add-ins
Gtk.TreeView tree = new Gtk.TreeView ();
addin_tree = new Mono.Addins.Gui.AddinTreeWidget (tree);
tree.Show ();
Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow ();
sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
sw.ShadowType = Gtk.ShadowType.In;
sw.Add (tree);
sw.Show ();
Gtk.LinkButton get_more_link =
new Gtk.LinkButton ("http://live.gnome.org/Tomboy/PluginList",
Catalog.GetString ("Get More Add-Ins..."));
get_more_link.Show ();
Gtk.VBox tree_box = new Gtk.VBox (false, 0);
tree_box.Add (sw);
tree_box.PackEnd (get_more_link, false, false, 5);
tree_box.Show ();
hbox.PackStart (tree_box, true, true, 0);
// Action Buttons (right of TreeView)
Gtk.VButtonBox button_box = new Gtk.VButtonBox ();
button_box.Spacing = 4;
button_box.Layout = Gtk.ButtonBoxStyle.Start;
// TODO: In a future version, add in an "Install Add-ins..." button
// TODO: In a future version, add in a "Repositories..." button
enable_addin_button =
new Gtk.Button (Catalog.GetString ("_Enable"));
enable_addin_button.Sensitive = false;
enable_addin_button.Clicked += OnEnableAddinButton;
enable_addin_button.Show ();
disable_addin_button =
new Gtk.Button (Catalog.GetString ("_Disable"));
disable_addin_button.Sensitive = false;
disable_addin_button.Clicked += OnDisableAddinButton;
disable_addin_button.Show ();
addin_prefs_button =
new Gtk.Button (Gtk.Stock.Preferences);
addin_prefs_button.Sensitive = false;
addin_prefs_button.Clicked += OnAddinPrefsButton;
addin_prefs_button.Show ();
addin_info_button =
new Gtk.Button (Gtk.Stock.Info);
addin_info_button.Sensitive = false;
addin_info_button.Clicked += OnAddinInfoButton;
addin_info_button.Show ();
button_box.PackStart (enable_addin_button);
button_box.PackStart (disable_addin_button);
button_box.PackStart (addin_prefs_button);
button_box.PackStart (addin_info_button);
button_box.Show ();
hbox.PackStart (button_box, false, false, 0);
hbox.Show ();
vbox.PackStart (hbox, true, true, 0);
vbox.Show ();
tree.Selection.Changed += OnAddinTreeSelectionChanged;
LoadAddins ();
return vbox;
}
示例13: CoverageView
public CoverageView(string fileName, ProgressBar status)
{
store = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string), typeof(object));
tree = new TreeView (store);
CellRendererText renderer = new CellRendererText ();
CellRendererText coverageRenderer = new CellRendererText ();
// LAME: Why is this property a float instead of a double ?
renderer.Xalign = 0.5f;
tree.AppendColumn ("Classes", new CellRendererText (), "text", 0);
tree.AppendColumn ("Lines Hit", renderer, "text", 1);
tree.AppendColumn ("Lines Missed", renderer, "text", 2);
tree.AppendColumn ("Coverage", coverageRenderer, "text", 3);
tree.GetColumn (0).Resizable = true;
tree.GetColumn (1).Alignment = 0.0f;
tree.GetColumn (1).Resizable = true;
tree.GetColumn (2).Alignment = 0.0f;
tree.GetColumn (2).Resizable = true;
tree.GetColumn (3).Alignment = 0.0f;
tree.GetColumn (3).Resizable = true;
tree.GetColumn (3).SetCellDataFunc (coverageRenderer, new TreeCellDataFunc (RenderCoverage));
tree.HeadersVisible = true;
model = new CoverageModel ();
foreach (string filter in DEFAULT_FILTERS) {
model.AddFilter (filter);
}
this.status = status;
model.Progress += Progress;
model.ReadFromFile (fileName);
TreeItem root = new TreeItem (store, null, model, "PROJECT");
Hashtable classes2 = model.Classes;
namespaces = new Hashtable ();
string[] sorted_names = new string[classes2.Count];
classes2.Keys.CopyTo (sorted_names, 0);
Array.Sort (sorted_names);
Progress ("Building tree", 0.95);
foreach (string name in sorted_names) {
ClassCoverageItem klass = (ClassCoverageItem)classes2[name];
if (klass.filtered)
continue;
string namespace2 = klass.name_space;
TreeItem nsItem = (TreeItem)namespaces[namespace2];
if (nsItem == null) {
nsItem = new TreeItem (store, root, (CoverageItem)model.Namespaces[namespace2], namespace2);
// nsItem.SetPixmap (0, namespaceOpenPixmap);
namespaces[namespace2] = nsItem;
}
if (nsItem.model.filtered)
continue;
ClassItem classItem = new ClassItem (store, nsItem, klass, klass.name);
if (klass.ChildCount != 0) {
TreeIter treeIter = store.AppendNode (classItem.iter);
store.SetValues (treeIter, "<loading>");
}
}
tree.ExpandRow (store.GetPath (root.Iter), false);
// it becomes very hard to navigate if everything is expanded
//foreach (string ns in namespaces.Keys)
// tree.ExpandRow (store.GetPath (((TreeItem)namespaces [ns]).Iter), false);
tree.RowExpanded += new RowExpandedHandler (OnRowExpanded);
tree.RowCollapsed += new RowCollapsedHandler (OnRowCollapsed);
tree.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPress);
tree.Selection.Mode = SelectionMode.Single;
Progress ("Done", 1.0);
// LAME: Why doesn't widgets visible by default ???
tree.Show ();
}