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


C# Button.ShowAll方法代码示例

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


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

示例1: AttachWidgets

		private void AttachWidgets (TextView textView)
		{
			// This is really different from the C version, but the
			// C versions seems a little pointless.

			Button button = new Button ("Click Me");
			button.Clicked +=  new EventHandler(EasterEggCB);
			textView.AddChildAtAnchor (button, buttonAnchor);
			button.ShowAll ();

			ComboBox combo = ComboBox.NewText ();
			combo.AppendText ("Option 1");
			combo.AppendText ("Option 2");
			combo.AppendText ("Option 3");

 			textView.AddChildAtAnchor (combo, menuAnchor);

			HScale scale = new HScale (null);
			scale.SetRange (0,100);
			scale.SetSizeRequest (70, -1);
			textView.AddChildAtAnchor (scale, scaleAnchor);
			scale.ShowAll ();

			Gtk.Image image = Gtk.Image.LoadFromResource ("floppybuddy.gif");
			textView.AddChildAtAnchor (image, animationAnchor);
			image.ShowAll ();

			Entry entry = new Entry ();
			textView.AddChildAtAnchor (entry, entryAnchor);
			entry.ShowAll ();
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:31,代码来源:DemoTextView.cs

示例2: OnRealized

		protected override void OnRealized ()
		{
			for (int i = 0; i < Buttons.Length; i++) {
				Gtk.Button button;
				button = new Gtk.Button (Buttons[i].Label);
				button.ShowAll ();
				AddActionWidget (button, i);
			}
			base.OnRealized ();
		}
开发者ID:slwatmough,项目名称:monodevelop,代码行数:10,代码来源:GtkErrorDialog.cs

示例3: MakeButton

		private Gtk.Button MakeButton (Gtk.HBox header, string icon, EventHandler handler)
		{
			Gtk.Button button = new Gtk.Button ();
			Gtk.Image img = new Gtk.Image (icon, Gtk.IconSize.Button);
			button.Add (img);
			button.Relief = Gtk.ReliefStyle.None;
			button.Clicked += handler;

			header.PackStart (button, false, false, 0);
			button.ShowAll ();

			return button;
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:13,代码来源:Category.cs

示例4: ItunesImportDialog

        public ItunesImportDialog()
            : base()
        {
            // TODO add Help button and dialog/tooltip

            Title = Catalog.GetString ("iTunes Importer");
            Resizable = false;
            ContentArea.BorderWidth = 8;
            ContentArea.Spacing = 8;

            Button cancel_button = new Button (Stock.Cancel);
            cancel_button.Clicked += delegate { Respond (ResponseType.Cancel); };
            cancel_button.ShowAll ();
            AddActionWidget (cancel_button, ResponseType.Cancel);
            cancel_button.CanDefault = true;
            cancel_button.GrabFocus ();
            DefaultResponse = ResponseType.Cancel;

            import_button = new Button ();
            import_button.Label = Catalog.GetString ("_Import");
            import_button.UseUnderline = true;
            import_button.Image = Image.NewFromIconName (Stock.Open, IconSize.Button);
            import_button.Clicked += delegate { Respond (ResponseType.Ok); };
            import_button.ShowAll ();
            AddActionWidget (import_button, ResponseType.Ok);

            VBox vbox = new VBox ();
            ratings = new CheckButton (Catalog.GetString ("Import song ratings"));
            ratings.Active = true;
            vbox.PackStart (ratings, false, false, 0);
            stats = new CheckButton (Catalog.GetString ("Import play statistics (playcount, etc.)"));
            stats.Active = true;
            vbox.PackStart (stats, false, false, 0);
            playlists = new CheckButton (Catalog.GetString ("Import playlists"));
            playlists.Active = true;
            vbox.PackStart (playlists, false, false, 0);

            PackCheckboxes (vbox);

            ContentArea.ShowAll ();
        }
开发者ID:knocte,项目名称:banshee,代码行数:41,代码来源:ItunesPlayerImportDialogs.cs

示例5: ComparisonWidget

		public ComparisonWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			leftVAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftVAdjustment, vAdjustment);
			
			rightVAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightVAdjustment, vAdjustment);
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			vScrollBar.Hide ();
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			leftHAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftHAdjustment, hAdjustment);
			
			rightHAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightHAdjustment, hAdjustment);
			
			leftHScrollBar = new HScrollbar (hAdjustment);
			AddChild (leftHScrollBar);
			
			rightHScrollBar = new HScrollbar (hAdjustment);
			AddChild (rightHScrollBar);
			
			originalEditor = new TextEditor ();
			originalEditor.Caret.PositionChanged += CaretPositionChanged;
			originalEditor.FocusInEvent += EditorFocusIn;
			AddChild (originalEditor);
			originalEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			
			originalComboBox = new DropDownBox ();
			originalComboBox.WindowRequestFunc = CreateComboBoxSelector;
			originalComboBox.Text = "Local";
			originalComboBox.Tag = originalEditor;
			AddChild (originalComboBox);
			
			diffEditor = new TextEditor ();
			diffEditor.Caret.PositionChanged += CaretPositionChanged;
			diffEditor.FocusInEvent += EditorFocusIn;
			
			AddChild (diffEditor);
			diffEditor.Document.ReadOnly = true;
			diffEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			this.vAdjustment.ValueChanged += delegate {
				middleArea.QueueDraw ();
			};
			
			diffComboBox = new DropDownBox ();
			diffComboBox.WindowRequestFunc = CreateComboBoxSelector;
			diffComboBox.Text = "Base";
			diffComboBox.Tag = diffEditor;
			AddChild (diffComboBox);
			
			
			overview = new OverviewRenderer (this);
			AddChild (overview);
			
			middleArea = new MiddleArea (this);
			AddChild (middleArea);
			
			prev = new Button ();
			prev.Add (new Arrow (ArrowType.Up, ShadowType.None));
			AddChild (prev);
			prev.ShowAll ();
			prev.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int max  = -1, searched = -1;
				foreach (Diff.Hunk hunk in this.Diff) {
					if (hunk.Same)
						continue;
					max = System.Math.Max (hunk.Right.Start, max);
					if (hunk.Right.Start < line)
						searched = System.Math.Max (hunk.Right.Start, searched);
				}
				if (max >= 0) {
					originalEditor.Caret.Line = searched < 0 ? max : searched;
					originalEditor.CenterToCaret ();
				}
			};
			
			next = new Button ();
			next.BorderWidth = 0;
			next.Add (new Arrow (ArrowType.Down, ShadowType.None));
			next.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int min  = Int32.MaxValue, searched = Int32.MaxValue;
				foreach (Diff.Hunk hunk in this.Diff) {
//.........这里部分代码省略.........
开发者ID:acken,项目名称:monodevelop,代码行数:101,代码来源:ComparisonWidget.cs

示例6: BuildPopup

        private void BuildPopup(double min, double max, double step)
        {
            dock = new Window(WindowType.Popup);
            dock.Screen = Screen;
            dock.ButtonPressEvent += OnDockButtonPressEvent;
            dock.KeyPressEvent += OnDockKeyPressEvent;
            dock.KeyReleaseEvent += OnDockKeyReleaseEvent;
            dock.ScrollEvent += OnPlusMinusScollEvent;
            dock.Hidden += OnDockHidden;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            dock.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();

            frame.Add(box);

            Label label = new Label();
            label.Markup = "<b><big>+</big></b>";
            plus = new Button(label);
            plus.Relief = ReliefStyle.None;
            plus.ButtonPressEvent += OnPlusMinusButtonPressEvent;
            plus.ButtonReleaseEvent += OnPlusMinusButtonReleaseEvent;
            plus.ScrollEvent += OnPlusMinusScollEvent;
            plus.ShowAll();
            box.PackStart(plus, false, true, 0);

            slider = new VolumeScale(this, min, max, step);
            slider.SetSizeRequest(-1, SCALE_SIZE);
            slider.DrawValue = false;
            slider.Inverted = true;
            slider.Show();
            box.PackStart(slider, true, true, 0);

            label = new Label();
            label.Markup = "<b><big>\u2212</big></b>";
            minus = new Button(label);
            minus.Relief = ReliefStyle.None;
            minus.ButtonPressEvent += OnPlusMinusButtonPressEvent;
            minus.ButtonReleaseEvent += OnPlusMinusButtonReleaseEvent;
            minus.ScrollEvent += OnPlusMinusScollEvent;
            minus.ShowAll();
            box.PackEnd(minus, false, true, 0);

            Show();
        }
开发者ID:mono-soc-2011,项目名称:banshee,代码行数:50,代码来源:VolumeButton.cs

示例7: BuildWidget

        private void BuildWidget()
        {
            ThreadAssist.AssertInMainThread ();
            ColumnSpacing = 5;
            RowSpacing = 2;

            icon = new Image ();

            title_label = new Label ();
            title_label.Xalign = 0.0f;
            title_label.Ellipsize = Pango.EllipsizeMode.End;

            status_label = new Label ();
            status_label.Xalign = 0.0f;
            status_label.Ellipsize = Pango.EllipsizeMode.End;

            progress_bar = new ProgressBar ();
            progress_bar.SetSizeRequest (0, -1);
            progress_bar.Text = " ";
            progress_bar.Show ();

            cancel_button = new Button (new Image (Stock.Stop, IconSize.Menu));
            cancel_button.Relief = ReliefStyle.None;
            cancel_button.ShowAll ();
            cancel_button.Clicked += OnCancelClicked;

            Attach (title_label, 0, 3, 0, 1,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            Attach (status_label, 0, 3, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            Attach (icon, 0, 1, 2, 3,
                AttachOptions.Shrink | AttachOptions.Fill,
                AttachOptions.Shrink | AttachOptions.Fill, 0, 0);

            Attach (progress_bar, 1, 2, 2, 3,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            Attach (cancel_button, 2, 3, 2, 3,
                AttachOptions.Shrink | AttachOptions.Fill,
                AttachOptions.Shrink | AttachOptions.Fill, 0, 0);
        }
开发者ID:knocte,项目名称:banshee,代码行数:46,代码来源:UserJobTile.cs

示例8: ContactRequestDialog

        public ContactRequestDialog(string contact_name)
            : base()
        {
            Title = AddinManager.CurrentLocalizer.GetString ("Contact Request");
            BorderWidth = 5;

            IconName = "gtk-dialog-authentication";

            accel_group = new AccelGroup ();
            AddAccelGroup (accel_group);

            HBox hbox = new HBox (false, 12);
            VBox vbox = new VBox (false, 0);
            hbox.BorderWidth = 5;
            vbox.Spacing = 5;
            hbox.Show ();
            vbox.Show ();

            Image image = new Image ();
            image.Yalign = 0.0f;
            image.IconName = "gtk-dialog-authentication";
            image.IconSize = (int)IconSize.Dialog;
            image.Show ();

            hbox.PackStart (image, false, false, 0);
            hbox.PackStart (vbox, true, true, 0);

            message = new Label (String.Format (AddinManager.CurrentLocalizer.GetString ("{0} would like to browse your music library."), contact_name));
            message.Xalign = 0.0f;
            message.Show ();

            vbox.PackStart (message, false, false, 0);

            ContentArea.PackStart (hbox, true, true, 0);
            ContentArea.Remove (ActionArea);
            ContentArea.Spacing = 10;

            HBox bottom_box = new HBox ();
            bottom_box.PackStart (ActionArea, false, false, 0);
            bottom_box.ShowAll ();
            ContentArea.PackEnd (bottom_box, false, false, 0);

            Button accept_button = new Button ();
            accept_button.Label = AddinManager.CurrentLocalizer.GetString ("Accept");
            accept_button.ShowAll ();
            accept_button.Activated += delegate {
                //login_form.Save ();
            };
            accept_button.Clicked += delegate {
                //login_form.Save ();
            };
            AddActionWidget (accept_button, ResponseType.Accept);

            Button reject_button = new Button ();
            reject_button.Label = AddinManager.CurrentLocalizer.GetString ("Reject");
            reject_button.ShowAll ();
            reject_button.Activated += delegate {
                //login_form.Save ();
            };
            reject_button.Clicked += delegate {
                //login_form.Save ();
            };
            AddActionWidget (reject_button, ResponseType.Reject);
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:64,代码来源:ContactRequestDialog.cs

示例9: Initialize

		public void Initialize (PropertyDescriptor prop)
		{
			if (!prop.PropertyType.IsEnum)
				throw new ApplicationException ("Flags editor does not support editing values of type " + prop.PropertyType);
				
			property = prop.Label;
			Spacing = 3;

			// For small enums, the editor is a list of checkboxes inside a frame
			// For large enums (>5), use a selector dialog.

			enm = Registry.LookupEnum (prop.PropertyType.FullName);
			
			if (enm.Values.Length < 6) 
			{
				Gtk.VBox vbox = new Gtk.VBox (true, 3);

				flags = new Hashtable ();

				foreach (Enum value in enm.Values) {
					EnumValue eval = enm[value];
					if (eval.Label == "")
						continue;

					Gtk.CheckButton check = new Gtk.CheckButton (eval.Label);
					check.TooltipText = eval.Description;
					uint uintVal = (uint) Convert.ToInt32 (eval.Value);
					flags[check] = uintVal;
					flags[uintVal] = check;
					
					check.Toggled += FlagToggled;
					vbox.PackStart (check, false, false, 0);
				}

				Gtk.Frame frame = new Gtk.Frame ();
				frame.Add (vbox);
				frame.ShowAll ();
				PackStart (frame, true, true, 0);
			} 
			else 
			{
				flagsLabel = new Gtk.Entry ();
				flagsLabel.IsEditable = false;
				flagsLabel.HasFrame = false;
				flagsLabel.ShowAll ();
				PackStart (flagsLabel, true, true, 0);
				
				Gtk.Button but = new Gtk.Button ("...");
				but.Clicked += OnSelectFlags;
				but.ShowAll ();
				PackStart (but, false, false, 0);
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:53,代码来源:Flags.cs

示例10: BuildHeader

        private void BuildHeader ()
        {
            header_table = new Table (2, 2, false);
            header_table.Show ();
            primary_vbox.PackStart (header_table, false, false, 0);

            main_menu = new MainMenu ();

            if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo) {
                main_menu.Show ();
                header_table.Attach (main_menu, 0, 1, 0, 1,
                    AttachOptions.Expand | AttachOptions.Fill,
                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = PlatformDetection.IsMeeGo ? 0u : 3u;
            toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show ();

            if (PlatformDetection.IsMeeGo) {
                header_toolbar.IconSize = IconSize.LargeToolbar;
                header_toolbar.Name = "meego-toolbar";
            }

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.Show ();

            header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton (ActionService, PlatformDetection.IsMeeGo);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
            seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay ();
            track_info_display.Show ();
            track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
            track_info_container.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            if (PlatformDetection.IsMeeGo) {
                track_info_display.ArtworkSpacing = 5;
                seek_slider.LeftPadding = 20;
                seek_slider.RightPadding = 20;

                var menu = (Menu)(ActionService.UIManager.GetWidget ("/ToolbarMenu"));
                var menu_button = new Hyena.Widgets.MenuButton (new Image (Stock.Preferences, IconSize.LargeToolbar), menu, true);
                menu_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button);

                var close_button = new Button (Image.NewFromIconName ("window-close", IconSize.LargeToolbar)) {
                    TooltipText = Catalog.GetString ("Close")
                };

                close_button.Clicked += (o, e) => Hide ();
                close_button.ShowAll ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button);
            } else {
                var volume_button = new ConnectedVolumeButton ();
                volume_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
            }
        }
开发者ID:petejohanson,项目名称:banshee,代码行数:77,代码来源:PlayerInterface.cs

示例11: RemoveAccountDialog

 public RemoveAccountDialog(DomainInformation domainInfo)
     : base()
 {
     this.Title = "";
        this.Resizable = false;
        this.HasSeparator = false;
        HBox h = new HBox();
        h.BorderWidth = 10;
        h.Spacing = 10;
        Image i = new Image();
        i.SetFromStock(Gtk.Stock.DialogQuestion, IconSize.Dialog);
        i.SetAlignment(0.5F, 0);
        h.PackStart(i, false, false, 0);
        VBox v = new VBox();
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
      Util.GS("Remove this iFolder account?") + "</span>");
        l.LineWrap = true;
        l.UseMarkup = true;
        l.Selectable = false;
        l.Xalign = 0; l.Yalign = 0;
        v.PackStart(l, false, false, 10);
        Table table = new Table(3, 2, false);
        table.RowSpacing = 0;
        table.ColumnSpacing = 10;
        table.Homogeneous = false;
        l = new Label(Util.GS("System Name:"));
        l.Xalign = 1;
        table.Attach(l, 0,1, 0,1,
        AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        l = new Label(domainInfo.Name);
        l.UseUnderline = false;
        l.Xalign = 0;
        table.Attach(l, 1,2, 0,1,
        AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        l = new Label(Util.GS("Server:"));
        l.Xalign = 1;
        table.Attach(l, 0,1, 1,2,
        AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        l = new Label(domainInfo.Host);
        l.Xalign = 0;
        table.Attach(l, 1,2, 1,2,
        AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        l = new Label(Util.GS("Username:"));
        l.Xalign = 1;
        table.Attach(l, 0,1, 2,3,
        AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        l = new Label(domainInfo.MemberName);
        l.UseUnderline = false;
        l.Xalign = 0;
        table.Attach(l, 1,2, 2,3,
        AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        v.PackEnd(table, true, true, 0);
        h.PackEnd(v);
        this.VBox.PackStart(h, true, true, 0);
        cbutton = new CheckButton(Util.GS("_Remove my iFolders and files from the server"));
        this.VBox.PackStart(cbutton, false, false, 10);
        cbutton.Toggled +=
     new EventHandler(OnRemoveiFoldersToggled);
        if (!domainInfo.Active || !domainInfo.Authenticated)
        {
     cbutton.Sensitive = false;
        }
        this.VBox.ShowAll();
        Button noButton = new Button(Stock.No);
        noButton.CanFocus = true;
        noButton.CanDefault = true;
        noButton.ShowAll();
        this.AddActionWidget(noButton, ResponseType.No);
        this.AddButton(Stock.Yes, ResponseType.Yes);
        this.DefaultResponse = ResponseType.No;
        this.FocusChild = noButton;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:72,代码来源:RemoveAccountDialog.cs

示例12: GtkErrorDialog

		public GtkErrorDialog (Window parent, string title, string message, AlertButton[] buttons)
		{
			if (string.IsNullOrEmpty (title))
				throw new ArgumentException ();
			if (buttons == null)
				throw new ArgumentException ();
			
			Title = BrandingService.ApplicationName;
			TransientFor = parent;
			Modal = true;
			WindowPosition = Gtk.WindowPosition.CenterOnParent;
			DefaultWidth = 624;
			DefaultHeight = 142;
			
			this.VBox.BorderWidth = 2;
			
			var hbox = new HBox () {
				Spacing = 6,
				BorderWidth = 12,
			};
			
			var errorImage = new Image (Gtk.Stock.DialogError, IconSize.Dialog) {
				Yalign = 0F,
			};
			hbox.PackStart (errorImage, false, false, 0);
			this.VBox.Add (hbox);
			
			var vbox = new VBox () {
				Spacing = 6,
			};
			hbox.PackEnd (vbox, true, true, 0);
			
			var titleLabel = new Label () {
				Markup = "<b>" + GLib.Markup.EscapeText (title) + "</b>",
				Xalign = 0F,
			};
			vbox.PackStart (titleLabel, false, false, 0);
			
			if (!string.IsNullOrWhiteSpace (message)) {
				message = message.Trim ();
				var descriptionLabel = new Label (message) {
					Xalign = 0F,
					Selectable = true,
				};
				descriptionLabel.LineWrap = true;
				descriptionLabel.WidthRequest = 500;
				descriptionLabel.ModifyBg (StateType.Normal, new Gdk.Color (255,0,0));
				vbox.PackStart (descriptionLabel, false, false, 0);
			}
			
			expander = new Expander (GettextCatalog.GetString ("Details")) {
				CanFocus = true,
				Visible = false,
			};
			vbox.PackEnd (expander, true, true, 0);
			
			var sw = new ScrolledWindow () {
				HeightRequest = 180,
				ShadowType = ShadowType.Out,
			};
			expander.Add (sw);
			
			detailsTextView = new TextView () {
				CanFocus = true,
			};
			detailsTextView.KeyPressEvent += TextViewKeyPressed;
			sw.Add (detailsTextView);
			
			var aa = this.ActionArea;
			aa.Spacing = 10;
			aa.LayoutStyle = ButtonBoxStyle.End;
			aa.BorderWidth = 5;
			aa.Homogeneous = true;
			
			expander.Activated += delegate {
				this.AllowGrow = expander.Expanded;
				GLib.Timeout.Add (100, delegate {
					Resize (DefaultWidth, 1);
					return false;
				});
			};
			
			tagNoWrap = new TextTag ("nowrap");
			tagNoWrap.WrapMode = WrapMode.None;
			detailsTextView.Buffer.TagTable.Add (tagNoWrap);
			
			tagWrap = new TextTag ("wrap");
			tagWrap.WrapMode = WrapMode.Word;
			detailsTextView.Buffer.TagTable.Add (tagWrap);
			
			this.Buttons = buttons;
			for (int i = 0; i < Buttons.Length; i++) {
				Gtk.Button button;
				button = new Gtk.Button (Buttons[i].Label);
				button.ShowAll ();
				AddActionWidget (button, i);
			}
			
			Child.ShowAll ();
			Hide ();
//.........这里部分代码省略.........
开发者ID:Kalnor,项目名称:monodevelop,代码行数:101,代码来源:GtkErrorDialog.cs

示例13: TabStrip

		public TabStrip (DockNotebook notebook)
		{
			TabWidth = 125;
			TargetWidth = 125;
			tracker = new MouseTracker (this);
			GtkWorkarounds.FixContainerLeak (this);

			this.notebook = notebook;
			WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
			Events |= Gdk.EventMask.PointerMotionMask | Gdk.EventMask.LeaveNotifyMask | Gdk.EventMask.ButtonPressMask;

			var arr = new Gtk.Image (Gdk.Pixbuf.LoadFromResource ("tabbar-prev.png"));
			arr.HeightRequest = arr.WidthRequest = 10;
			PreviousButton = new Button (arr);
			PreviousButton.Relief = ReliefStyle.None;
			PreviousButton.CanDefault = PreviousButton.CanFocus = false;

			arr = new Gtk.Image (Gdk.Pixbuf.LoadFromResource ("tabbar-next.png"));
			arr.HeightRequest = arr.WidthRequest = 10;
			NextButton = new Button (arr);
			NextButton.Relief = ReliefStyle.None;
			NextButton.CanDefault = NextButton.CanFocus = false;

			DropDownButton = new MenuButton ();
			DropDownButton.Relief = ReliefStyle.None;
			DropDownButton.CanDefault = DropDownButton.CanFocus = false;

			PreviousButton.ShowAll ();
			NextButton.ShowAll ();
			DropDownButton.ShowAll ();

			PreviousButton.Name = "MonoDevelop.DockNotebook.BarButton";
			NextButton.Name = "MonoDevelop.DockNotebook.BarButton";
			DropDownButton.Name = "MonoDevelop.DockNotebook.BarButton";

			PreviousButton.Parent = this;
			NextButton.Parent = this;
			DropDownButton.Parent = this;

			children.Add (PreviousButton);
			children.Add (NextButton);
			children.Add (DropDownButton);

			tracker.HoveredChanged += (sender, e) => {
				if (!tracker.Hovered) {
					SetHighlightedTab (null);
					UpdateTabWidth (tabEndX - tabStartX);
					QueueDraw ();
				}
			};

			notebook.PageAdded += (object sender, EventArgs e) => QueueResize ();
			notebook.PageRemoved += (object sender, EventArgs e) => QueueResize ();

			closingTabs = new Dictionary<int, DockNotebookTab> ();
		}
开发者ID:halleyxu,项目名称:monodevelop,代码行数:56,代码来源:DockNotebook.cs

示例14: AddSwitchToPrimaryInterface

 private void AddSwitchToPrimaryInterface ()
 {
     // Add switcher to primary interface:
     var app_button = new Button (new Image () {
         IconSize = (int)IconSize.LargeToolbar,
         IconName = "media-player-banshee"
     }) {
         TooltipText = Catalog.GetString ("Show the Netbook interface")
     };
     app_button.Clicked += (o, e) => {
         //ServiceManager.SourceManager.SetActiveSource (ServiceManager.SourceManager.MusicLibrary);
         ServiceManager.Get<MeeGoService> ().PresentNetbookInterface ();
     };
     Toolbar header_toolbar;
     InterfaceActionService action_service;
     action_service = ServiceManager.Get<InterfaceActionService> ();
     header_toolbar = (Toolbar)action_service.UIManager.GetWidget ("/HeaderToolbar");
     app_button.ShowAll ();
     action_service.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ExtensionToolBarPlaceHolder", app_button);
 }
开发者ID:fatman2021,项目名称:gnome-apps,代码行数:20,代码来源:MeeGoService.cs

示例15: ItunesMusicDirectoryDialog

        public ItunesMusicDirectoryDialog(string itunes_music_directory)
            : base()
        {
            Title = Catalog.GetString ("Locate iTunes Music Directory");
            DefaultHeight = 650;
            DefaultWidth = 814;

            Button cancel_button = new Button (Stock.Cancel);
            cancel_button.Clicked += delegate { Respond (ResponseType.Cancel); };
            cancel_button.ShowAll ();
            AddActionWidget (cancel_button, ResponseType.Cancel);
            cancel_button.CanDefault = true;
            cancel_button.GrabFocus ();

            Button ok_button = new Button (Stock.Ok);
            ok_button.Clicked += delegate { Respond (ResponseType.Ok); };
            ok_button.ShowAll ();
            AddActionWidget (ok_button, ResponseType.Ok);

            VBox vbox = new VBox ();
            vbox.BorderWidth = 8;
            vbox.Spacing = 10;

            HBox hbox = new HBox ();
            hbox.Spacing = 10;

            Image image = new Image (Stock.DialogWarning, IconSize.Dialog);
            hbox.PackStart (image, false, true, 0);

            Label message = new Label ();
            message.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText(
                String.Format (Catalog.GetString(
                    "The iTunes library refers to your music directory as \"{0}\" but " +
                    "Banshee was not able to infer the location of this directory. Please locate it."),
                itunes_music_directory)));
            message.Justify = Justification.Left;
            message.WidthRequest = 750;
            message.LineWrap = true;
            hbox.PackStart (message, true, true, 0);

            vbox.PackStart (hbox, false, true, 0);

            chooser = new FileChooserWidget (FileChooserAction.SelectFolder);
            chooser.ShowAll ();
            vbox.PackStart (chooser, true, true, 0);

            ContentArea.PackStart (vbox, true, true, 0);

            DefaultResponse = ResponseType.Cancel;

            ContentArea.ShowAll ();
        }
开发者ID:knocte,项目名称:banshee,代码行数:52,代码来源:ItunesPlayerImportDialogs.cs


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