本文整理汇总了C#中Gtk.Entry.UseNativeContextMenus方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.UseNativeContextMenus方法的具体用法?C# Entry.UseNativeContextMenus怎么用?C# Entry.UseNativeContextMenus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Entry
的用法示例。
在下文中一共展示了Entry.UseNativeContextMenus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildWidget
private void BuildWidget ()
{
alignment = new Alignment (0.5f, 0.5f, 1f, 0f);
alignment.SetPadding (1, 1, 3, 3);
VisibleWindow = false;
box = new HBox ();
entry = new FramelessEntry (this);
entry.UseNativeContextMenus ();
filter_button = new HoverImageButton (IconSize.Menu, "md-searchbox-search");
clear_button = new HoverImageButton (IconSize.Menu, "md-searchbox-clear");
entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
alignment.SetPadding (0, 0, 3, 3);
entryAlignment.Add (entry);
box.PackStart (filter_button, false, false, 0);
box.PackStart (entryAlignment, true, true, 0);
box.PackStart (clear_button, false, false, 0);
alignment.Add (box);
Add (alignment);
alignment.ShowAll ();
entry.StyleSet += OnInnerEntryStyleSet;
entry.StateChanged += OnInnerEntryStateChanged;
entry.FocusInEvent += OnInnerEntryFocusEvent;
entry.FocusOutEvent += OnInnerEntryFocusEvent;
entry.Changed += OnInnerEntryChanged;
entry.Activated += delegate {
NotifyActivated ();
};
filter_button.CanFocus = false;
clear_button.CanFocus = false;
filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
clear_button.Clicked += OnClearButtonClicked;
ShowHideButtons ();
}