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