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


C# Gtk.Dialog类代码示例

本文整理汇总了C#中Gtk.Dialog的典型用法代码示例。如果您正苦于以下问题:C# Dialog类的具体用法?C# Dialog怎么用?C# Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Dialog类属于Gtk命名空间,在下文中一共展示了Dialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnAddPls

 public void OnAddPls()
 {
     Hyena.Log.Information ("add playlist");
     Gtk.Dialog dlg=new Gtk.Dialog();
     dlg.Title="Add Playlist";
     Gtk.Entry pls=new Gtk.Entry();
     pls.WidthChars=40;
     Gtk.Label lbl=new Gtk.Label("Playlist name:");
     Gtk.HBox hb=new Gtk.HBox();
     hb.PackStart (lbl,false,false,1);
     hb.PackEnd (pls);
     dlg.VBox.PackStart (hb);
     dlg.AddButton (Gtk.Stock.Cancel,0);
     dlg.AddButton (Gtk.Stock.Ok,1);
     dlg.VBox.ShowAll ();
     string plsname="";
     while (plsname=="") {
         int response=dlg.Run ();
         if (response==0) {
             dlg.Hide ();
             dlg.Destroy ();
             return;
         } else {
             plsname=pls.Text.Trim ();
         }
     }
     dlg.Hide ();
     dlg.Destroy ();
     _pls=_col.NewPlayList(plsname);
     _model.Reload ();
     _pls_model.SetPlayList (_pls);
 }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:32,代码来源:CS_PlayListAdmin.cs

示例2: BookEditor

 public BookEditor()
 {
     Glade.XML gxml = new Glade.XML (Util.GladePath("contact-browser.glade"),
      "BookEditor", null);
        gxml.Autoconnect (this);
        beDlg = (Gtk.Dialog) gxml.GetWidget("BookEditor");
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:7,代码来源:BookEditor.cs

示例3: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Title = "Bi-directional flipping";
			window.SetDefaultSize (200, 100);

			label = new Label ("Label direction: <b>Left-to-right</b>");
			label.UseMarkup = true;
			label.SetPadding (3, 3);
			window.VBox.PackStart (label, true, true, 0);

			check_button = new CheckButton ("Toggle label direction");
			window.VBox.PackStart (check_button, true, true, 2);

			if (window.Direction == TextDirection.Ltr)
				check_button.Active = true;

			check_button.Toggled += new EventHandler (Toggle_Flip);
			check_button.BorderWidth = 10;

			button = new Button (Stock.Close);
			button.Clicked += new EventHandler (Close_Button);
			button.CanDefault = true;
			
			window.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			window.ShowAll ();
			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:30,代码来源:TestFlipping.cs

示例4: Main

        public static void Main(string[] args)
        {
            Application.Init ();

             			try {
                InfoManager.Init ();
            } catch (Exception e) {
                Dialog d = new Dialog ("Error", null, DialogFlags.Modal, new object [] {
                    "OK", ResponseType.Ok });
                d.VBox.Add (new Label ("There was a problem while trying to initialize the InfoManager\n\n" + e.ToString ()));
                d.VBox.ShowAll ();
                d.Run ();
                return;
            }

            string profile_path = null;
            if (args.Length != 0 && args[0].StartsWith ("--profile-path="))
                profile_path = args[0].Substring (15);

            MainWindow win = new MainWindow (profile_path);
            win.Show ();
            if (args.Length == 2 && File.Exists (args [0]) && File.Exists (args [1])){
                win.ComparePaths (args [0], args [1]);
            }
            Application.Run ();
        }
开发者ID:FreeBSD-DotNet,项目名称:mono-tools,代码行数:26,代码来源:Main.cs

示例5: Create

		public static Gtk.Window Create ()
		{
			window = new Dialog ();
			window.Response += new ResponseHandler (Print_Response);
			window.SetDefaultSize (200, 100);

			window.Title = "GtkDialog";
			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (Close_Button);
			button.CanDefault = true;
			window.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			ToggleButton toggle_button = new ToggleButton ("Toggle Label");
			toggle_button.Clicked += new EventHandler (Label_Toggle);
			window.ActionArea.PackStart (toggle_button, true, true, 0);

			toggle_button = new ToggleButton ("Toggle Separator");
			toggle_button.Clicked += new EventHandler (Separator_Toggle);
			window.ActionArea.PackStart (toggle_button, true, true, 0);

			window.ShowAll ();

			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:TestDialog.cs

示例6: Init

	/* Protected members */

	protected void Init (Gtk.Dialog dialog) {
		this.dialog = dialog;
		Util.SetBaseWindowFromUi(dialog);

		dialog.Response += OnResponse;
		dialog.DeleteEvent += OnDeleteEvent;
	}
开发者ID:GNOME,项目名称:gnome-subtitles,代码行数:9,代码来源:BaseDialog.cs

示例7: EditPlayer

        public override void EditPlayer(Text text)
        {
            playerText = text;
            if (playerDialog == null) {
                Gtk.Dialog d = new Gtk.Dialog (Catalog.GetString ("Select player"),
                                   this, DialogFlags.Modal | DialogFlags.DestroyWithParent,
                                   Stock.Cancel, ResponseType.Cancel);
                d.WidthRequest = 600;
                d.HeightRequest = 400;

                DrawingArea da = new DrawingArea ();
                TeamTagger tagger = new TeamTagger (new WidgetWrapper (da));
                tagger.ShowSubstitutionButtons = false;
                tagger.LoadTeams ((ViewModel.Project as ProjectLongoMatch).LocalTeamTemplate, (ViewModel.Project as ProjectLongoMatch).VisitorTeamTemplate,
                                  (ViewModel.Project as ProjectLongoMatch).Dashboard.FieldBackground);
                tagger.PlayersSelectionChangedEvent += players => {
                    if (players.Count == 1) {
                        Player p = players [0];
                        playerText.Value = p.ToString ();
                        d.Respond (ResponseType.Ok);
                    }
                    tagger.ResetSelection ();
                };
                d.VBox.PackStart (da, true, true, 0);
                d.ShowAll ();
                playerDialog = d;
            }
            if (playerDialog.Run () != (int)ResponseType.Ok) {
                text.Value = null;
            }
            playerDialog.Hide ();
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:32,代码来源:SportDrawingTool.cs

示例8: onClick

 private void onClick(object Sender, EventArgs e)
 {
     Dialog d = new Dialog ("Test", this, DialogFlags.DestroyWithParent);
     d.Modal = true;
     d.AddButton ("Close", ResponseType.Close);
     d.Run ();
     d.Destroy ();
 }
开发者ID:MASGAU,项目名称:gtk-sharp-ribbon,代码行数:8,代码来源:DropdownGroupTest.cs

示例9: PreferencesDialog

        public PreferencesDialog(Settings set, Window parent,
				 string argsOver)
        {
            settings = set;
            argsOverride = argsOver;

            dialog = new Dialog("Preferences", parent,
            DialogFlags.Modal | DialogFlags.DestroyWithParent,
            new object[]{Gtk.Stock.Close, -1});

            var table = new Table(4, 3, false);

            sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
            sUseBundledDebugger.Clicked += OnBundledState;
            table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            Label lbl;

            lbl = new Label("MSPDebug path:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugPath = new Entry();
            table.Attach(sMSPDebugPath, 1, 2, 1, 2,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);
            chooseMSPDebug = new Button("Choose...");
            chooseMSPDebug.Clicked += OnChoose;
            table.Attach(chooseMSPDebug, 2, 3, 1, 2,
             AttachOptions.Fill, 0, 4, 4);

            lbl = new Label("MSPDebug arguments:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugArgs = new Entry();
            sMSPDebugArgs.Sensitive = (argsOverride == null);
            table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            lbl = new Label("Console font:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
            sConsoleFont = new FontButton();
            table.Attach(sConsoleFont, 1, 3, 3, 4,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            table.ShowAll();
            ((Container)dialog.Child).Add(table);

            chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
            dialog, FileChooserAction.Open,
            new object[]{Stock.Cancel, ResponseType.Cancel,
                 Stock.Ok, ResponseType.Ok});
            chooseDialog.DefaultResponse = ResponseType.Ok;
        }
开发者ID:dlbeer,项目名称:olishell,代码行数:58,代码来源:PreferencesDialog.cs

示例10: Dispose

		public void Dispose ()
		{
			if (GotoLineDialog != null) {
				GotoLineDialog.Dispose ();
				GotoLineDialog = null;
				line_number_entry = null;
				IsVisible = false;
			}
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:9,代码来源:GotoLineNumberDialog.cs

示例11: ErrorDialog

 static ErrorDialog()
 {
     XML gxml = new Glade.XML (null,
                   WorkbenchSingleton.GLADEFILE,
                   "ErrorDialog",
                   null);
     dialog = (Dialog) gxml["ErrorDialog"];
     Gtk.TextView errorTextView = (TextView) gxml["errorTextView"];
     errorBuffer = errorTextView.Buffer;
 }
开发者ID:BackupTheBerlios,项目名称:simetron,代码行数:10,代码来源:ErrorDialog.cs

示例12: Initialize

 void Initialize(Window parent)
 {
     Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");
     Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
     stream.Close();
     glade.Autoconnect(this);
     thisDialog = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
     thisDialog.Modal = true;
     thisDialog.TransientFor = parent;
     thisDialog.SetPosition (WindowPosition.Center);
 }
开发者ID:jdpillon,项目名称:ArduinoLadder,代码行数:11,代码来源:OpenFileDialog.cs

示例13: GladeDialog

        public GladeDialog(string name)
            : base(name)
        {
            dialog = base.Window as Dialog;

            if (dialog != null) {
                dialog.Response += delegate (object o, ResponseArgs args) {
                    OnResponse (args.ResponseId);
                };
            }
        }
开发者ID:manicolosi,项目名称:questar,代码行数:11,代码来源:GladeDialog.cs

示例14: ImportDialog

 static ImportDialog()
 {
     gxml = new Glade.XML (null,
                   WorkbenchSingleton.GLADEFILE,
                   "ImportDialog",
                   null);
     importDialog = (Dialog) gxml["ImportDialog"];
     typeCombo = (Combo) gxml["typeCombo"];
     formatCombo = (Combo) gxml["formatCombo"];
     okButton = (Button) gxml["okButton"];
 }
开发者ID:BackupTheBerlios,项目名称:simetron,代码行数:11,代码来源:ImportDialog.cs

示例15: RunDialog

		private bool RunDialog (Dialog dlg)
		{
			bool result = false;
			try {	
				if (dlg.Run () == (int)ResponseType.Ok)
					result = true;
			} finally {
				dlg.Destroy ();
			}
			return result;
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:10,代码来源:SqlServerGuiProvider.cs


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