本文整理汇总了C#中Gtk.Menu.Realize方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.Realize方法的具体用法?C# Menu.Realize怎么用?C# Menu.Realize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Menu
的用法示例。
在下文中一共展示了Menu.Realize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NoteTextMenu
//.........这里部分代码省略.........
MarkupLabel (large);
large.Data ["Tag"] = "size:large";
large.Activated += FontSizeActivated;
small = new Gtk.RadioMenuItem (large.Group,
"<span size=\"small\">" +
Catalog.GetString ("S_mall") +
"</span>");
MarkupLabel (small);
small.Data ["Tag"] = "size:small";
small.Activated += FontSizeActivated;
hidden_no_size = new Gtk.RadioMenuItem (small.Group, string.Empty);
hidden_no_size.Hide ();
increase_font = new Gtk.MenuItem (Catalog.GetString ("Increase Font Size"));
increase_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.plus,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
increase_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.KP_Add,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
increase_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.equal,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
increase_font.Activated += IncreaseFontClicked;
decrease_font = new Gtk.MenuItem (Catalog.GetString ("Decrease Font Size"));
decrease_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.minus,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
decrease_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.KP_Subtract,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
decrease_font.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.underscore,
Gdk.ModifierType.ControlMask,
Gtk.AccelFlags.Visible);
decrease_font.Activated += DecreaseFontClicked;
Gtk.SeparatorMenuItem spacer2 = new Gtk.SeparatorMenuItem ();
bullets = new Gtk.CheckMenuItem (Catalog.GetString ("Bullets"));
bullets.Activated += ToggleBulletsClicked;
increase_indent = new Gtk.ImageMenuItem (Gtk.Stock.Indent, accel_group);
increase_indent.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.Right,
Gdk.ModifierType.Mod1Mask,
Gtk.AccelFlags.Visible);
increase_indent.Activated += IncreaseIndentClicked;
increase_indent.Show ();
decrease_indent = new Gtk.ImageMenuItem (Gtk.Stock.Unindent, accel_group);
decrease_indent.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.Left,
Gdk.ModifierType.Mod1Mask,
Gtk.AccelFlags.Visible);
decrease_indent.Activated += DecreaseIndentClicked;
decrease_indent.Show ();
RefreshState ();
Append (bold);
Append (italic);
Append (strikeout);
Append (highlight);
Append (spacer1);
Append (font_size);
Append (small);
Append (normal);
Append (large);
Append (huge);
Append (increase_font);
Append (decrease_font);
Append (spacer2);
Append (bullets);
Append (increase_indent);
Append (decrease_indent);
ShowAll ();
theme_hack_menu = new Menu ();
theme_hack_menu.Realize ();
theme_hack_menu.StyleSet += delegate {
ModifyBg (StateType.Normal, theme_hack_menu.Style.Background (StateType.Normal));
};
}