本文整理汇总了C#中Gtk.MessageDialog.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.MessageDialog.Show方法的具体用法?C# Gtk.MessageDialog.Show怎么用?C# Gtk.MessageDialog.Show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.MessageDialog
的用法示例。
在下文中一共展示了Gtk.MessageDialog.Show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: on_okButton_clicked
void on_okButton_clicked(object o, EventArgs args)
{
if (Core.Settings.KeyEncrypted && !Core.Settings.CheckKeyPassword(oldPasswordEntry.Text)) {
Gui.ShowErrorDialog("Old password incorrect");
oldPasswordEntry.GrabFocus();
return;
}
if (newPasswordEntry.Text != confirmPasswordEntry.Text) {
Gui.ShowErrorDialog("New passwords do not match");
newPasswordEntry.GrabFocus();
return;
}
if (newPasswordEntry.Text == String.Empty) {
var dialog = new Gtk.MessageDialog(base.Window, Gtk.DialogFlags.Modal, Gtk.MessageType.Question, Gtk.ButtonsType.YesNo, "Are you sure you don't want to set a password?");
dialog.Show();
int r = dialog.Run();
dialog.Destroy();
if (r != (int)Gtk.ResponseType.Yes) {
return;
}
}
Core.Settings.ChangeKeyPassword(newPasswordEntry.Text);
if (!Core.Settings.FirstRun)
Gui.ShowMessageDialog("Your password has been changed.");
Dialog.Respond(Gtk.ResponseType.Ok);
}
示例2: ClearRecent
void ClearRecent ()
{
Gtk.MessageDialog md = new Gtk.MessageDialog (null,
0,
Gtk.MessageType.Warning,
Gtk.ButtonsType.None,
"<b><big>" + Catalog.GetString ("Clear the Recent Documents list?") + "</big></b>");
md.Title = Catalog.GetString ("Clear Recent Documents");
md.Icon = DockServices.Drawing.LoadIcon ("docky", 22);
md.SecondaryText = Catalog.GetString ("If you clear the Recent Documents list, you clear the following:\n" +
"\u2022 All items from the Places \u2192 Recent Documents menu item.\n" +
"\u2022 All items from the recent documents list in all applications.");
md.Modal = false;
md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
md.AddButton (Gtk.Stock.Clear, Gtk.ResponseType.Ok);
md.DefaultResponse = Gtk.ResponseType.Ok;
md.Response += (o, args) => {
if (args.ResponseId != Gtk.ResponseType.Cancel)
Gtk.RecentManager.Default.PurgeItems ();
md.Destroy ();
};
md.Show ();
}
示例3: EmptyTrash
void EmptyTrash ()
{
if (ConfirmTrashDelete) {
Gtk.MessageDialog md = new Gtk.MessageDialog (null,
0,
Gtk.MessageType.Warning,
Gtk.ButtonsType.None,
"<b><big>" + Catalog.GetString ("Empty all of the items from the trash?") + "</big></b>");
md.Icon = DockServices.Drawing.LoadIcon ("docky", 22);
md.SecondaryText = Catalog.GetString ("If you choose to empty the trash, all items in it\n" +
"will be permanently lost. Please note that you\n" +
"can also delete them separately.");
md.Modal = false;
md.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
md.AddButton (Catalog.GetString ("Empty _Trash"), Gtk.ResponseType.Ok);
md.DefaultResponse = Gtk.ResponseType.Ok;
md.Response += (o, args) => {
if (args.ResponseId != Gtk.ResponseType.Cancel)
PerformEmptyTrash ();
md.Destroy ();
};
md.Show ();
} else {
PerformEmptyTrash ();
}
}