本文整理汇总了C#中Gtk.TreeViewColumn.CellSetCellData方法的典型用法代码示例。如果您正苦于以下问题:C# TreeViewColumn.CellSetCellData方法的具体用法?C# TreeViewColumn.CellSetCellData怎么用?C# TreeViewColumn.CellSetCellData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeViewColumn
的用法示例。
在下文中一共展示了TreeViewColumn.CellSetCellData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CellTooltipWindow
public CellTooltipWindow (TreeView tree, TreeViewColumn col, TreePath path)
{
this.tree = tree;
this.col = col;
NudgeHorizontal = true;
Events |= Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.EnterNotifyMask | Gdk.EventMask.LeaveNotifyMask;
Gdk.Rectangle rect = tree.GetCellArea (path, col);
rect.Inflate (2, 2);
if (!tree.Model.GetIter (out iter, path)) {
Hide ();
return;
}
col.CellSetCellData (tree.Model, iter, false, false);
int x = 0;
int th = 0;
CellRenderer[] renderers = col.CellRenderers;
foreach (CellRenderer cr in renderers) {
int sp, wi, he, xo, yo;
col.CellGetPosition (cr, out sp, out wi);
Gdk.Rectangle crect = new Gdk.Rectangle (x, rect.Y, wi, rect.Height);
cr.GetSize (tree, ref crect, out xo, out yo, out wi, out he);
if (cr != renderers [renderers.Length - 1])
x += crect.Width + col.Spacing + 1;
else
x += wi + 1;
if (he > th) th = he;
}
SetSizeRequest (x, th + 2);
}