本文整理汇总了C#中Gtk.Button.AddAccelerator方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Button.AddAccelerator方法的具体用法?C# Gtk.Button.AddAccelerator怎么用?C# Gtk.Button.AddAccelerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Button
的用法示例。
在下文中一共展示了Gtk.Button.AddAccelerator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddButton
void AddButton (string stock_id, Gtk.ResponseType response, bool is_default)
{
Gtk.Button button = new Gtk.Button (stock_id);
button.CanDefault = true;
button.Show ();
AddActionWidget (button, response);
if (is_default) {
DefaultResponse = response;
button.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.Escape,
0,
Gtk.AccelFlags.Visible);
}
}
示例2: PreferencesDialog
public PreferencesDialog (AddinManager addin_manager)
: base ()
{
this.addin_manager = addin_manager;
IconName = "tomboy";
HasSeparator = false;
BorderWidth = 5;
Resizable = true;
Title = Catalog.GetString ("Tomboy Preferences");
ActionArea.Layout = Gtk.ButtonBoxStyle.End;
addin_prefs_dialogs =
new Dictionary<string, Gtk.Dialog> ();
addin_info_dialogs =
new Dictionary<string, Gtk.Dialog> ();
// Notebook Tabs (Editing, Hotkeys)...
Gtk.Notebook notebook = new Gtk.Notebook ();
notebook.TabPos = Gtk.PositionType.Top;
notebook.Show ();
notebook.AppendPage (MakeEditingPane (),
new Gtk.Label (Catalog.GetString ("Editing")));
if (! (Services.Keybinder is NullKeybinder))
notebook.AppendPage (MakeHotkeysPane (),
new Gtk.Label (Catalog.GetString ("Hotkeys")));
notebook.AppendPage (MakeSyncPane (),
new Gtk.Label (Catalog.GetString ("Synchronization")));
notebook.AppendPage (MakeAddinsPane (),
new Gtk.Label (Catalog.GetString ("Add-ins")));
// TODO: Figure out a way to have these be placed in a specific order
foreach (PreferenceTabAddin tabAddin in addin_manager.GetPreferenceTabAddins ()) {
Logger.Debug ("Adding preference tab addin: {0}", tabAddin.GetType ().Name);
try {
string tabName;
Gtk.Widget tabWidget;
if (tabAddin.GetPreferenceTabWidget (this, out tabName, out tabWidget) == true) {
notebook.AppendPage (tabWidget, new Gtk.Label (tabName));
}
} catch (Exception e) {
Logger.Warn ("Problems adding preferences tab addin: {0}", tabAddin.GetType ().Name);
Logger.Debug ("{0}:\n{1}", e.Message, e.StackTrace);
}
}
VBox.PackStart (notebook, true, true, 0);
addin_manager.ApplicationAddinListChanged += OnAppAddinListChanged;
// Ok button...
Gtk.Button button = new Gtk.Button (Gtk.Stock.Close);
button.CanDefault = true;
button.Show ();
Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
AddAccelGroup (accel_group);
button.AddAccelerator ("activate",
accel_group,
(uint) Gdk.Key.Escape,
0,
0);
AddActionWidget (button, Gtk.ResponseType.Close);
DefaultResponse = Gtk.ResponseType.Close;
Preferences.SettingChanged += HandlePreferencesSettingChanged;
}