本文整理汇总了C#中Gtk.VBox.HideAll方法的典型用法代码示例。如果您正苦于以下问题:C# VBox.HideAll方法的具体用法?C# VBox.HideAll怎么用?C# VBox.HideAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.VBox
的用法示例。
在下文中一共展示了VBox.HideAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeTemplateBar
private Gtk.Box MakeTemplateBar ()
{
// TODO: Move these to static area
Tag template_tag = TagManager.GetOrCreateSystemTag (TagManager.TemplateNoteSystemTag);
Tag template_save_size_tag = TagManager.GetOrCreateSystemTag (TagManager.TemplateNoteSaveSizeSystemTag);
Tag template_save_selection_tag = TagManager.GetOrCreateSystemTag (TagManager.TemplateNoteSaveSelectionSystemTag);
Tag template_save_title_tag = TagManager.GetOrCreateSystemTag (TagManager.TemplateNoteSaveTitleSystemTag);
var bar = new Gtk.VBox ();
var infoLabel = new Gtk.Label (Catalog.GetString ("This note is a template note. It determines " +
"the default content of regular notes, and will " +
"not show up in the note menu or search window."));
infoLabel.Wrap = true;
var untemplateButton = new Gtk.Button ();
untemplateButton.Label = Catalog.GetString ("Convert to regular note");
untemplateButton.Clicked += (o, e) => {
note.RemoveTag (template_tag);
};
var saveSizeCheckbutton = new Gtk.CheckButton (Catalog.GetString ("Save Si_ze"));
saveSizeCheckbutton.Active = note.ContainsTag (template_save_size_tag);
saveSizeCheckbutton.Toggled += (o, e) => {
if (saveSizeCheckbutton.Active)
note.AddTag (template_save_size_tag);
else
note.RemoveTag (template_save_size_tag);
};
var saveSelectionCheckbutton = new Gtk.CheckButton (Catalog.GetString ("Save Se_lection"));
saveSelectionCheckbutton.Active = note.ContainsTag (template_save_selection_tag);
saveSelectionCheckbutton.Toggled += (o, e) => {
if (saveSelectionCheckbutton.Active)
note.AddTag (template_save_selection_tag);
else
note.RemoveTag (template_save_selection_tag);
};
var saveTitleCheckbutton = new Gtk.CheckButton (Catalog.GetString ("Save _Title"));
saveTitleCheckbutton.Active = note.ContainsTag (template_save_title_tag);
saveTitleCheckbutton.Toggled += (o, e) => {
if (saveTitleCheckbutton.Active)
note.AddTag (template_save_title_tag);
else
note.RemoveTag (template_save_title_tag);
};
bar.PackStart (infoLabel);
bar.PackStart (untemplateButton);
bar.PackStart (saveSizeCheckbutton);
bar.PackStart (saveSelectionCheckbutton);
bar.PackStart (saveTitleCheckbutton);
if (note.ContainsTag (template_tag))
bar.ShowAll ();
note.TagAdded += delegate (Note taggedNote, Tag tag) {
if (taggedNote == note && tag == template_tag)
bar.ShowAll ();
};
note.TagRemoved += delegate (Note taggedNote, string tag) {
if (taggedNote == note && tag == template_tag.NormalizedName)
bar.HideAll ();
};
return bar;
}