本文整理汇总了C#中Gtk.TreeView.RemoveColumn方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.RemoveColumn方法的具体用法?C# TreeView.RemoveColumn怎么用?C# TreeView.RemoveColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeView
的用法示例。
在下文中一共展示了TreeView.RemoveColumn方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClearColumns
public static void ClearColumns(TreeView treeView)
{
treeView.Model=null;//Antes de llamar a RemoveColumn para evitar los Gtk.Critical
TreeViewColumn[] treeViewColumns = treeView.Columns;
foreach (TreeViewColumn treeViewColumn in treeViewColumns)
treeView.RemoveColumn (treeViewColumn);
}
示例2: removeAllColumns
private static void removeAllColumns(TreeView treeView)
{
//vaciar el array
TreeViewColumn[] treeViewColumns = treeView.Columns;
foreach (TreeViewColumn treeViewColumn in treeViewColumns)
treeView.RemoveColumn (treeViewColumn);
}
示例3: removeAllColumns
private static void removeAllColumns(TreeView treeView)
{
TreeViewColumn[] treeViewColumns = treeView.Columns;
foreach(TreeViewColumn treeViewColumn in treeViewColumns){
treeView.RemoveColumn (treeViewColumn);
}
}
示例4: ClearColumns
public static void ClearColumns(TreeView treeView)
{
treeView.Model = null;
TreeViewColumn[] treeViewColumns = treeView.Columns;
foreach (TreeViewColumn treeViewColumn in treeViewColumns)
treeView.RemoveColumn (treeViewColumn);
}
示例5: Clear
/**
* Removes all columns from a GTK treeview. I didn't find a better way
* to completely clear a treeview :-/.
* @param treeview The pointer to the treeview widget we'd like to clear.
**/
public static void Clear(TreeView treeview)
{
#if DEBUG
Console.WriteLine("TreeViewHelper.Clear");
#endif
if (treeview != null) {
for (int i = treeview.Columns.Length - 1; i >= 0; i--) {
treeview.RemoveColumn(treeview.Columns[i]);
}
treeview.Model = null;
}
}
示例6: foreach
/////////////////////////////////////////////////////////////////////////////////
///<summary>
///Build a tree with xml nodes
///</summary>
///<param name="node">xml node</param>
///<param name="parent">row parent</param>
/*public void BuildTree (XmlNode node, TreeIter parent)
{
if (!node.HasChildNodes)
return;
else
{
XmlNodeList childNodeList = node.ChildNodes;
foreach (XmlNode childNode in childNodeList)
{
if (childNode.Name == "node")
{
// Creamos el diccionario con los valores de las columnas.
IDictionary colValues = new Hashtable();
XmlNodeList childs = childNode.ChildNodes;
int i = 0;
foreach (XmlNode child in childs)
if (child.Name == "column")
colValues[i++] = child.Attributes["value"].Value;
TreeIter newParent = InsertRow (parent, colValues);
BuildTree (childNode, newParent);
}
}
}
} // build_tree
*/
public static void RemoveColumns(TreeView tv)
{
TreeViewColumn[] columns = tv.Columns;
foreach (TreeViewColumn column in columns)
tv.RemoveColumn (column);
}
示例7: removeColmns
private static void removeColmns(TreeView treeView)
{
foreach (TreeViewColumn col in treeView.Columns) {
treeView.RemoveColumn (col);
}
}
示例8: getRunsTreeView
/// <summary>
/// Gets the tree view.
/// </summary>
/// <returns>The tree view.</returns>
private Gtk.TreeView getRunsTreeView(List<RunSession> sessions)
{
var treeView = new Gtk.TreeView ();
// Create liststore
var types = new System.Type[3];
for (int typeNumber = 0; typeNumber < types.Length; ++typeNumber) {
types [typeNumber] = typeof(string);
}
Gtk.ListStore listStore = new Gtk.ListStore (types);
treeView.Model = listStore;
// Delete existing columns
while (treeView.Columns.Length > 0) {
treeView.RemoveColumn (treeView.Columns [0]);
}
// Create started column
var columnStarted = new Gtk.TreeViewColumn ();
var cellStarted = new Gtk.CellRendererText ();
columnStarted.Title = "Started (hh:mm:ss)";
columnStarted.PackStart (cellStarted, true);
cellStarted.Editable = false;
cellStarted.Foreground = "black";
cellStarted.Background = "light gray";
columnStarted.AddAttribute (cellStarted, "text", 0);
treeView.AppendColumn (columnStarted);
// Create runned column
var columnRunned = new Gtk.TreeViewColumn ();
var cellRunned = new Gtk.CellRendererText ();
columnRunned.Title = "Distance (m)";
columnRunned.PackStart (cellRunned, true);
cellRunned.Editable = false;
cellRunned.Foreground = "black";
cellRunned.Background = "light gray";
columnRunned.AddAttribute (cellRunned, "text", 1);
treeView.AppendColumn (columnRunned);
// Create distance column
var columnDistance = new Gtk.TreeViewColumn ();
var cellDistance = new Gtk.CellRendererText ();
columnDistance.Title = "Runned (hh:mm:ss)";
columnDistance.PackStart (cellDistance, true);
cellDistance.Editable = false;
cellDistance.Foreground = "black";
cellDistance.Background = "light gray";
columnDistance.AddAttribute (cellDistance, "text", 2);
treeView.AppendColumn (columnDistance);
var row = new List<string> ();
foreach (RunSession s in sessions) {
// Insert data
row.Clear ();
////////////////////////AKIIIIIIIIIII
///
var date = this.runFilter.FromUnixTime (s.Start);
Console.Write ("date "+date.ToString ());
var hour = date.Hour + ":" + date.Minute + ":" + date.Second;
var distance = s.Distance;
var duration = TimeSpan.FromSeconds (s.Duration).ToString (@"hh\:mm\:ss");
row.Insert (0, Convert.ToString (hour));
row.Insert (1, Convert.ToString (distance));
row.Insert (2, Convert.ToString (duration));
listStore.AppendValues (row.ToArray ());
}
treeView.EnableGridLines = Gtk.TreeViewGridLines.Both;
treeView.HeadersClickable = true;
return treeView;
}
示例9: getStatsTreeView
/// <summary>
/// Gets the tree view.
/// </summary>
/// <returns>The tree view.</returns>
private Gtk.TreeView getStatsTreeView(bool flag)
{
var treeView = new Gtk.TreeView ();
try {
// Create liststore
var types = new System.Type[4];
for(int typeNumber = 0; typeNumber < types.Length; ++typeNumber) {
types[ typeNumber ] = typeof( string );
}
Gtk.ListStore listStore = new Gtk.ListStore( types );
treeView.Model = listStore;
// Delete existing columns
while(treeView.Columns.Length > 0) {
treeView.RemoveColumn( treeView.Columns[ 0 ] );
}
// Create index column
var column = new Gtk.TreeViewColumn();
var cell = new Gtk.CellRendererText();
column.Title = "Stats";
column.PackStart( cell, true );
cell.Editable = false;
cell.Foreground = "black";
cell.Background = "light gray";
column.AddAttribute( cell, "text", 0 );
treeView.AppendColumn( column );
// Create columns belonging to the document
for(int colNum = 0; colNum < 1; ++colNum) {
column = new Gtk.TreeViewColumn();
column.Expand = true;
cell = new Gtk.CellRendererText();
column.PackStart( cell, true );
cell.Editable = false;
column.AddAttribute( cell, "text", colNum + 1 );
treeView.AppendColumn( column );
}
if(flag==true){
// Insert data
var row = new List<string>();
row.Clear();
row.Insert( 0, "Distance" );
row.Insert(1,fa.getDistTot());
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Steps" );
row.Insert(1,fa.getNumStpsTot());
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Hours" );
row.Insert(1,fa.getNumHourTot());
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Average speed" );
row.Insert(1,fa.getVelMedTot());
listStore.AppendValues( row.ToArray() );
}
else{
// Insert data
var row = new List<string>();
row.Clear();
row.Insert( 0, "Distance" );
row.Insert(1,fa.getDistDay(dia));
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Steps" );
row.Insert(1,fa.getNumStpsDay(dia));
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Hours" );
row.Insert(1,fa.getNumHourDay(dia));
listStore.AppendValues( row.ToArray() );
row = new List<string>();
row.Clear();
row.Insert( 0, "Average speed" );
row.Insert(1,fa.getVelMedDay(dia));
listStore.AppendValues( row.ToArray() );
}
} catch(Exception e) {
Console.Write (e);
}
//.........这里部分代码省略.........
示例10: SetColumns
private static void SetColumns(TreeView tv, bool waiting)
{
foreach (TreeViewColumn c in tv.Columns)
tv.RemoveColumn(c);
TreeViewColumn col;
CellRendererText leftAlignedTR = new CellRendererText();
leftAlignedTR.Xalign = 0.0f;
leftAlignedTR.Ellipsize = Pango.EllipsizeMode.End;
if (waiting) {
col = new TreeViewColumn(string.Empty, leftAlignedTR, "text", 0);
col.Resizable = true;
col.Alignment = 0.0f;
tv.AppendColumn(col);
} else {
col = new TreeViewColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 0);
col.Resizable = false;
col.Expand = false;
tv.AppendColumn(col);
col = new TreeViewColumn(S._("Drive"), leftAlignedTR, "text", 1);
col.Resizable = true;
col.Expand = true;
col.Alignment = 0.0f;
tv.AppendColumn(col);
col = new TreeViewColumn(S._("Label"), leftAlignedTR, "text", 2);
col.Resizable = true;
col.Expand = true;
col.Alignment = 0.0f;
tv.AppendColumn(col);
CellRendererText rightAlignedTR = new CellRendererText();
rightAlignedTR.Xalign = 1.0f;
col = new TreeViewColumn(S._("Size"), rightAlignedTR, "text", 3);
col.Resizable = true;
col.Expand = false;
col.Alignment = 1.0f;
tv.AppendColumn(col);
}
}
示例11: removeAllColumns
private static void removeAllColumns(TreeView treeView)
{
TreeViewColumn[] columnas = treeView.Columns;
for (int i = 0; i < columnas.Length;i++)
treeView.RemoveColumn (columnas[i]);
}
示例12: ClearColumns
public static void ClearColumns(TreeView treeView)
{
TreeViewColumn[] treeViewColumns = treeView.Columns;//para cada una: foreach
foreach (TreeViewColumn treeViewColumn in treeViewColumns)
treeView.RemoveColumn (treeViewColumn);
}
示例13: refresh
private void refresh(TreeView treeView,TreeViewHelper helper)
{
ListStore listStore=helper.ListStore;
int fieldCountArticulo=helper.getFieldCount();
for (int i=0;i<fieldCountArticulo;i++){//elimina columnas
treeView.RemoveColumn(treeView.GetColumn(0));
}
listStore.Clear();
listStore=helper.ListStore;
helper.actualizar(helper.IDbCommand,listStore);
}
示例14: Init
/// <summary>
/// Creates the number of columns needed.
/// </summary>
/// <param name="tv">
/// A <see cref="Gtk.TreeView"/> that will be the base.
/// </param>
/// <param name="numCols">
/// A <see cref="System.Int32"/> holding the number of columns.
/// </param>
/// <param name="mutability">
/// A <see cref="System.Array"/> holding the mutability of columns.
/// </param>
protected void Init(Gtk.TreeView tv, int numCols, bool[] mutability)
{
this.numCols = numCols;
this.tvTable = tv;
this.headers = new string[ this.NumCols ];
// Chk
if ( this.NumCols < 1 ) {
throw new ArgumentException( "number of cols must be > 0" );
}
// Create
var types = new System.Type[ this.NumCols ];
for(int i = 0; i < this.NumCols; ++i)
{
types[ i ] = typeof( string );
}
Gtk.ListStore listStore = new Gtk.ListStore( types );
tvTable.Model = listStore;
// Delete existing columns
while(tvTable.Columns.Length > 0) {
tvTable.RemoveColumn( tvTable.Columns[ 0 ] );
}
// Create index column
var column = new Gtk.TreeViewColumn();
var cell = new Gtk.CellRendererText();
column.Title = "#";
column.PackStart( cell, true );
if ( !mutability[ 0 ] ) {
cell.Editable = false;
cell.Foreground = "black";
cell.Background = "light gray";
} else {
cell.Editable = true;
}
column.AddAttribute( cell, "text", 0 );
tvTable.AppendColumn( column );
// Add columns
for(int colNum = 0; colNum < this.NumCols -1; ++colNum)
{
column = new Gtk.TreeViewColumn();
cell = new Gtk.CellRendererText();
column.Title = this.Headers[ colNum ];
column.PackStart( cell, true );
cell.Editable = mutability[ colNum +1 ];
if ( !mutability[ colNum +1 ] ) {
cell.Foreground = "black";
cell.Background = "light gray";
}
column.AddAttribute( cell, "text", colNum + 1 );
cell.Edited += OnCellEdited;
tvTable.AppendColumn( column );
}
}