本文整理汇总了C#中Gtk.ScrolledWindow.RenderIcon方法的典型用法代码示例。如果您正苦于以下问题:C# ScrolledWindow.RenderIcon方法的具体用法?C# ScrolledWindow.RenderIcon怎么用?C# ScrolledWindow.RenderIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.ScrolledWindow
的用法示例。
在下文中一共展示了ScrolledWindow.RenderIcon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
//.........这里部分代码省略.........
errorBtn.Toggled += new EventHandler (FilterChanged);
errorBtn.TooltipText = errorTipText;
UpdateErrorsNum();
toolbar.Add (errorBtn);
warnBtn = new ToggleButton ();
warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
string warnTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Warn) != EnabledLoggingLevel.Warn) {
warnBtn.Sensitive = false;
warnTipText = GettextCatalog.GetString ("Logging of warnings is not enabled");
} else {
warnTipText = GettextCatalog.GetString ("Show warnings");
}
warnBtn.Image = new Gtk.Image (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
warnBtn.Image.Show ();
warnBtn.Toggled += new EventHandler (FilterChanged);
warnBtn.TooltipText = warnTipText;
UpdateWarningsNum();
toolbar.Add (warnBtn);
msgBtn = new ToggleButton ();
msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
string msgTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Info) != EnabledLoggingLevel.Info) {
msgBtn.Sensitive = false;
msgTipText = GettextCatalog.GetString ("Logging of informational messages is not enabled");
} else {
msgTipText = GettextCatalog.GetString ("Show messages");
}
msgBtn.Image = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu);
msgBtn.Image.Show ();
msgBtn.Toggled += new EventHandler (FilterChanged);
msgBtn.TooltipText = msgTipText;
UpdateMessagesNum();
toolbar.Add (msgBtn);
debugBtn = new ToggleButton ();
debugBtn.Active = (bool)PropertyService.Get (showDebugPropertyName, true);
string debugTipText;
if ((InternalLog.EnabledLoggingLevel & EnabledLoggingLevel.Debug) != EnabledLoggingLevel.Debug) {
debugBtn.Sensitive = false;
debugTipText = GettextCatalog.GetString ("Logging of debug messages is not enabled");
} else {
debugTipText = GettextCatalog.GetString ("Show debug");
}
debugBtn.Image = new Gtk.Image (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu);
debugBtn.Image.Show ();
debugBtn.Toggled += new EventHandler (FilterChanged);
debugBtn.TooltipText = debugTipText;
UpdateDebugNum();
toolbar.Add (debugBtn);
toolbar.Add (new SeparatorToolItem ());
Gtk.Button clearBtn = new Gtk.Button (new Gtk.Image (Gtk.Stock.Clear, Gtk.IconSize.Menu));
clearBtn.Clicked += new EventHandler (OnClearList);
toolbar.Add (clearBtn);
toolbar.ShowAll ();
// Content
store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type
typeof (string), // desc
typeof (string), // time
typeof (string), // type string
typeof (LogMessage)); // message
TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
filter = new TreeModelFilter (store, null);
filter.VisibleFunc = filterFunct;
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (new Gtk.TreeModelSort (filter));
view.RulesHint = true;
view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
view.HeadersClickable = true;
view.Selection.Mode = SelectionMode.Multiple;
AddColumns ();
sw = new Gtk.ScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (view);
LoggingService.AddLogger (this);
iconWarning = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
iconError = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
iconDebug = sw.RenderIcon (Gtk.Stock.DialogQuestion, Gtk.IconSize.Menu, "");
control = sw;
sw.ShowAll ();
Refresh ();
store.SetSortFunc ((int)Columns.Time, TimeSortFunc);
((TreeModelSort)view.Model).SetSortColumnId ((int)Columns.Time, SortType.Descending);
}
示例2: CreateControl
void CreateControl ()
{
control = new HPaned ();
store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type
typeof (bool), // read?
typeof (Task)); // read? -- use Pango weight
TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
filter = new TreeModelFilter (store, null);
filter.VisibleFunc = filterFunct;
sort = new TreeModelSort (filter);
sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort);
sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort);
sort.SetSortFunc (VisibleColumns.File, FileIterSort);
view = new PadTreeView (sort);
view.RulesHint = true;
view.DoPopupMenu = (evnt) => IdeApp.CommandService.ShowContextMenu (view, evnt, CreateMenu ());
AddColumns ();
LoadColumnsVisibility ();
view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type;
view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File;
sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (view);
TaskService.Errors.TasksRemoved += DispatchService.GuiDispatch<TaskEventHandler> (ShowResults);
TaskService.Errors.TasksAdded += DispatchService.GuiDispatch<TaskEventHandler> (TaskAdded);
TaskService.Errors.TasksChanged += DispatchService.GuiDispatch<TaskEventHandler> (TaskChanged);
TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
view.RowActivated += new RowActivatedHandler (OnRowActivated);
iconWarning = sw.RenderIcon (Stock.Warning, Gtk.IconSize.Menu, "");
iconError = sw.RenderIcon (Stock.Error, Gtk.IconSize.Menu, "");
iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
control.Add1 (sw);
outputView = new LogView ();
control.Add2 (outputView);
Control.ShowAll ();
control.SizeAllocated += HandleControlSizeAllocated;
bool outputVisible = PropertyService.Get<bool> (outputViewVisiblePropertyName, false);
if (outputVisible) {
outputView.Visible = true;
logBtn.Active = true;
} else {
outputView.Hide ();
}
sw.SizeAllocated += HandleSwSizeAllocated;
// Load existing tasks
foreach (Task t in TaskService.Errors) {
AddTask (t);
}
control.FocusChain = new Gtk.Widget [] { sw };
}
示例3: CreateControl
void CreateControl ()
{
control = new HPaned ();
store = new Gtk.ListStore (typeof (Gdk.Pixbuf), // image - type
typeof (bool), // read?
typeof (Task)); // read? -- use Pango weight
TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc (FilterTaskTypes);
filter = new TreeModelFilter (store, null);
filter.VisibleFunc = filterFunct;
sort = new TreeModelSort (filter);
sort.SetSortFunc (VisibleColumns.Type, SeverityIterSort);
sort.SetSortFunc (VisibleColumns.Project, ProjectIterSort);
sort.SetSortFunc (VisibleColumns.File, FileIterSort);
view = new MonoDevelop.Ide.Gui.Components.PadTreeView (sort);
view.RulesHint = true;
view.PopupMenu += new PopupMenuHandler (OnPopupMenu);
view.ButtonPressEvent += new ButtonPressEventHandler (OnButtonPressed);
AddColumns ();
LoadColumnsVisibility ();
view.Columns[VisibleColumns.Type].SortColumnId = VisibleColumns.Type;
view.Columns[VisibleColumns.Project].SortColumnId = VisibleColumns.Project;
view.Columns[VisibleColumns.File].SortColumnId = VisibleColumns.File;
sw = new MonoDevelop.Components.CompactScrolledWindow ();
sw.ShadowType = ShadowType.None;
sw.Add (view);
TaskService.Errors.TasksRemoved += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (ShowResults));
TaskService.Errors.TasksAdded += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (TaskAdded));
TaskService.Errors.TasksChanged += (TaskEventHandler) DispatchService.GuiDispatch (new TaskEventHandler (TaskChanged));
TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged;
IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen;
IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed;
view.RowActivated += new RowActivatedHandler (OnRowActivated);
iconWarning = sw.RenderIcon (Gtk.Stock.DialogWarning, Gtk.IconSize.Menu, "");
iconError = sw.RenderIcon (Gtk.Stock.DialogError, Gtk.IconSize.Menu, "");
iconInfo = sw.RenderIcon (Gtk.Stock.DialogInfo, Gtk.IconSize.Menu, "");
control.Add1 (sw);
outputView = new LogView ();
control.Add2 (outputView);
Control.ShowAll ();
sw.SizeAllocated += delegate {
if (outputView.Visible)
PropertyService.Set (logSeparatorPositionPropertyName, (double) ((double) control.Position / (double) control.Allocation.Width));
};
outputView.Hide ();
CreateMenu ();
// Load existing tasks
foreach (Task t in TaskService.Errors) {
AddTask (t);
}
control.FocusChain = new Gtk.Widget [] { sw };
}