本文整理汇总了C#中Gtk.TreeView.ModifyFont方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.ModifyFont方法的具体用法?C# TreeView.ModifyFont怎么用?C# TreeView.ModifyFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.TreeView
的用法示例。
在下文中一共展示了TreeView.ModifyFont方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: DataGrid
public DataGrid () : base(false, 4)
{
ScrolledWindow sw = new ScrolledWindow ();
this.PackStart (sw, true, true, 0);
treeView = new TreeView (store);
treeView.HeadersVisible = true;
treeView.ModifyFont (Pango.FontDescription.FromString ("courier new"));
gridColumns = new ArrayList(0);
sw.Add (treeView);
store = new ListStore (GLib.GType.String);
dataMember = "";
dataSource = null;
}
示例3: ProcessOutput
public ProcessOutput()
{
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 tvcName = new TreeViewColumn (MainClass.Languages.Translate("Name"), new CellRendererText(), "text", 0);
tvcName.MinWidth = 100;
treeView.AppendColumn(tvcName);
TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Stat"), new CellRendererText(), "text", 1);
tvcState.MinWidth = 100;
treeView.AppendColumn(tvcState);
TreeViewColumn tvcMessage = new TreeViewColumn (MainClass.Languages.Translate("Message"), new CellRendererText(), "text", 2);
tvcMessage.MinWidth = 100;
treeView.AppendColumn(tvcMessage);
TreeViewColumn tvcPlace = new TreeViewColumn (MainClass.Languages.Translate("Place"), new CellRendererText(), "text", 3);
tvcPlace.MinWidth = 100;
treeView.AppendColumn(tvcPlace);
treeView.HeadersVisible = true;
treeView.EnableTreeLines = true;
treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
treeView.EnableSearch =false;
treeView.HasFocus = false;
outputDispatcher = new GLib.TimeoutHandler(OutputDispatchHandler);
this.Add(treeView);
this.ShowAll();
}
示例4: ErrorOutput
public ErrorOutput()
{
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);
//treeView.AppendColumn("Name", new CellRendererText(), "text", 0);
//treeView.AppendColumn("Stat", new CellRendererText(), "text", 1);
//treeView.AppendColumn("Message", new CellRendererText(), "text", 2);
//treeView.AppendColumn("Place", new CellRendererText(), "text", 3);
TreeViewColumn tvcName = new TreeViewColumn (MainClass.Languages.Translate("file"), new CellRendererText(), "text", 0);
tvcName.MinWidth = 100;
tvcName.Resizable = true;
treeView.AppendColumn(tvcName);
TreeViewColumn tvcState = new TreeViewColumn (MainClass.Languages.Translate("Line"), new CellRendererText(), "text", 1);
tvcState.MinWidth = 25;
tvcState.Resizable = true;
treeView.AppendColumn(tvcState);
TreeViewColumn tvcMessage = new TreeViewColumn (MainClass.Languages.Translate("message"), new CellRendererText(), "text", 2);
tvcMessage.MinWidth = 100;
tvcMessage.Resizable = true;
treeView.AppendColumn(tvcMessage);
TreeViewColumn tvcPlace = new TreeViewColumn (MainClass.Languages.Translate("location"), new CellRendererText(), "text", 3);
tvcPlace.MinWidth = 100;
tvcPlace.Resizable = true;
treeView.AppendColumn(tvcPlace);
treeView.HeadersVisible = true;
treeView.EnableTreeLines = true;
treeView.RowActivated += new RowActivatedHandler(OnRowActivate);
treeView.EnableSearch =false;
treeView.HasFocus = false;
treeView.ButtonReleaseEvent += delegate(object o, ButtonReleaseEventArgs args) {
if (args.Event.Button != 3) return;
Menu popupMenu = new Menu();
MenuItem miClear = new MenuItem( MainClass.Languages.Translate("clear" ));
miClear.Activated+= delegate(object sender, EventArgs e) {
Clear();
};
popupMenu.Append(miClear);
TreeSelection ts = treeView.Selection;
Gtk.TreePath[] selRow = ts.GetSelectedRows();
MenuItem miCopy = new MenuItem( MainClass.Languages.Translate("copy_f2" ));
miCopy.Activated+= delegate(object sender, EventArgs e) {
Gtk.TreePath tp = selRow[0];
TreeIter ti = new TreeIter();
outputModel.GetIter(out ti, tp);
string type = outputModel.GetValue(ti, 0).ToString();
string timeStamp = outputModel.GetValue(ti, 1).ToString();
string message = outputModel.GetValue(ti, 2).ToString();
Gtk.Clipboard clipboard = this.GetClipboard(Gdk.Selection.Clipboard);
string txt =type +"\t"+timeStamp+"\t"+message;
clipboard.Text=txt;
};
popupMenu.Append(miCopy);
if(selRow.Length<1){
miCopy.Sensitive = false;
}
popupMenu.Popup();
popupMenu.ShowAll();
};
outputDispatcher = new GLib.TimeoutHandler(OutputDispatchHandler);
this.Add(treeView);
this.ShowAll();
}