当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.MessageDialog.Show方法代码示例

本文整理汇总了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);
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:31,代码来源:ChangeKeyPasswordDialog.cs

示例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 ();
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:27,代码来源:RecentFilesProvider.cs

示例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 ();
			}
		}
开发者ID:Aurora-and-Equinox,项目名称:docky,代码行数:29,代码来源:TrashDockItem.cs


注:本文中的Gtk.MessageDialog.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。