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


C# Widget.Show方法代码示例

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


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

示例1: AddWidget

        private void AddWidget (PreferenceBase preference, Widget widget, Widget mnemonic_widget)
        {
            uint start_row = NRows;
            uint start_col = 0;

            Label label = null;

            if (!(widget is CheckButton) && preference.ShowLabel) {
                label = AttachLabel (preference.Name, start_row);
                start_col++;
            }

            widget.Show ();
            Attach (widget, start_col, 2, start_row, start_row + 1,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Expand | AttachOptions.Fill, 0, 0);

            if (label != null) {
                label.MnemonicWidget = mnemonic_widget ?? widget;
            }

            if (!String.IsNullOrEmpty (preference.Description)) {
                if (tp_host == null) {
                     tp_host = TooltipSetter.CreateHost ();
                }

                TooltipSetter.Set (tp_host, widget, preference.Description);
                if (label != null) {
                    TooltipSetter.Set (tp_host, label, preference.Description);
                }
            }
        }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:32,代码来源:SectionBox.cs

示例2: OneWidgetDialog

        public OneWidgetDialog(Widget widget)
        {
            this.Build ();

            var att = widget.GetType ().GetCustomAttributes (typeof(WidgetWindowAttribute), false);
            if (att.Length > 0)
                this.SetDefaultSize ((att [0] as WidgetWindowAttribute).DefaultWidth,
                                     (att [0] as WidgetWindowAttribute).DefaultHeight);

            widget.Show ();
            VBox.Add (widget);

            att = widget.GetType ().GetCustomAttributes (typeof(DisplayNameAttribute), true);
            if (att.Length > 0)
                Title = (att [0] as DisplayNameAttribute).DisplayName;

            tdiTab = widget as ITdiTab;
            if(tdiTab != null)
            {
                if(!String.IsNullOrWhiteSpace (tdiTab.TabName))
                    Title = tdiTab.TabName;
                tdiTab.TabParent = this;
                tdiTab.TabNameChanged += TdiTab_TabNameChanged;
                tdiTab.CloseTab += TdiTab_CloseTab;
            }

            this.ReshowWithInitialSize ();
        }
开发者ID:QualitySolution,项目名称:QSProjects,代码行数:28,代码来源:OneWidgetDialog.cs

示例3: Append

        public void Append(Widget w)
        {
            w.Parent = this;
            w.Show ();

            lines.Add (w);
            QueueDraw ();
        }
开发者ID:mono,项目名称:stetic,代码行数:8,代码来源:Grid.cs

示例4: AddWidgetItem

 public static void AddWidgetItem(this Toolbar tb, Widget w)
 {
     w.Show ();
     ToolItem ti = new ToolItem ();
     ti.Add (w);
     ti.Show ();
     tb.Insert (ti, tb.NItems);
 }
开发者ID:pzsysa,项目名称:gtk-sharp-forms,代码行数:8,代码来源:GtkExtensions.cs

示例5: SetDetailWidget

		void SetDetailWidget (Widget detail)
		{
			var child2 = Child2;
			if (child2 != null) {
				Remove (child2);
			}

			detail = detail ?? new Label ();
			detail.WidthRequest = 300;
			detail.Show ();

			Pack2 (detail, true, false);
		}
开发者ID:Therzok,项目名称:MonoDevelop.AddinMaker,代码行数:13,代码来源:AddinBrowserWidget.cs

示例6: Pair

			public Pair (Grid grid, string name, Widget editor, string description)
			{
				Gtk.Label l = new Label (name);
				l.UseMarkup = true;
				l.Justify = Justification.Left;
				l.Xalign = 0;
				l.Show ();

				if (description == null)
					label = l;
				else {
					Gtk.EventBox ebox = new Gtk.EventBox ();
					ebox.Add (l);
					ebox.Show ();
					ebox.TooltipText = description;
					label = ebox;
				}
				label.Parent = grid;

				this.editor = editor;
				editor.Parent = grid;
				editor.Show ();
			}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:23,代码来源:Grid.cs

示例7: OnBackendComboBoxChanged

        private void OnBackendComboBoxChanged(object sender, EventArgs args)
        {
            if (selectedBackend >= 0) {
                // TODO: Prompt the user and make sure they really want to change
                // which backend they are using.

                // Remove the existing backend's preference page
                if (backendPageId >= 0) {
                    notebook.RemovePage (backendPageId);
                    backendPageId = -1;
                    backendPage = null;
                }

                // if yes (replace backend)
                if (backendComboMap.ContainsKey (selectedBackend)) {
                    // Cleanup old backend
                    IBackend oldBackend = backendComboMap [selectedBackend];
                    Logger.Info ("Cleaning up '{0}'...", oldBackend.Name);
                    try {
                        oldBackend.Cleanup ();
                    } catch (Exception e) {
                        Logger.Warn ("Exception cleaning up '{0}': {2}",
                                     oldBackend.Name,
                                     e.Message);

                    }

                    selectedBackend = -1;
                }
            }

            IBackend newBackend = null;
            if (backendComboMap.ContainsKey (backendComboBox.Active)) {
                newBackend = backendComboMap [backendComboBox.Active];
            }

            // TODO: Set the new backend
            Application.Backend = newBackend;

            if (newBackend == null)
                return;

            selectedBackend = backendComboBox.Active;

            // Add a backend prefs page if one exists
            backendPage = newBackend.GetPreferencesWidget ();
            if (backendPage != null) {
                backendPage.Show ();
                Label l = new Label (GLib.Markup.EscapeText (newBackend.Name));
                l.UseMarkup = false;
                l.UseUnderline = false;
                l.Show ();
                backendPageId =
                    notebook.AppendPage (backendPage, l);

                // If the new backend is not configured, automatically switch
                // to the backend's preferences page
                if (!newBackend.Configured)
                    notebook.Page = backendPageId;
            }

            // Save the user preference
            Application.Preferences.Set (Preferences.CurrentBackend,
                                         newBackend.GetType ().ToString ());

            //categoriesToHide = BuildNewCategoryList ();
            //Application.Preferences.SetStringList (Preferences.HideInAllCategory,
            //									   categoriesToHide);
            RebuildCategoryTree ();
        }
开发者ID:nolith,项目名称:tasque,代码行数:70,代码来源:PreferencesDialog.cs

示例8: PaddingBox

 private Widget PaddingBox (Widget child)
 {
     var box = new HBox () { BorderWidth = 4 };
     box.PackStart (child, true, true, 0);
     child.Show ();
     box.Show ();
     return box;
 }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:8,代码来源:HomeView.cs

示例9: SetHeaderWidget

 public void SetHeaderWidget (Widget widget)
 {
     if (widget != null) {
         source_actions_box.Add (widget);
         widget.Show ();
         source_actions_align.Show ();
     }
 }
开发者ID:gclark916,项目名称:banshee,代码行数:8,代码来源:ViewContainer.cs

示例10: SetFooter

 public void SetFooter (Widget contents)
 {
     if (contents != null) {
         footer.PackStart (contents, false, false, 0);
         contents.Show ();
         footer.Show ();
     }
 }
开发者ID:gclark916,项目名称:banshee,代码行数:8,代码来源:ViewContainer.cs

示例11: Pack

		public void Pack (Widget aWidget)
		{
			if (aWidget == null)
				return;
			
			if ((Count > 0) && (SeparatorLines == true)) {
				//System.Console.WriteLine("Separator");
				VSeparator vs = new VSeparator();
				vs.Show();
				widgets[Count-1].PackEnd (vs, false, false, 0);
			}

			widgets.Add (new HBox());
			widgets[Count-1].Spacing = 3;
			widgets[Count-1].Show();
			if (Homogeneous == true)
				mainbox.PackStart (widgets[Count-1], true, true, 0);
			else
				mainbox.PackStart (widgets[Count-1], false, false, 0);
			if (aWidget is HComboCell) {
				(aWidget as HComboCell).BorderWidth = 1;
				aWidget.Show();
				widgets[Count-1].PackStart (aWidget, true, true, 0);
			}
			else {
				HComboCell eb = new HComboCellWidget (aWidget);
				eb.BorderWidth = 1;
				aWidget.Show();
				eb.Show();
				widgets[Count-1].PackStart (eb, true, true, 0);
			}
			if (Count == 1)
				Selected = 0;
		}
开发者ID:QualitySolution,项目名称:Gtk.DataBindings,代码行数:34,代码来源:HorizontalCombo.cs

示例12: SetPanel

 public void SetPanel(Widget panel)
 {
     if (panel == null) {
         ResetGUI ();
     } else {
         if (currentPanel is IAnalysisWindow && panel is PreferencesPanel) {
             RemovePanel (true);
         } else {
             RemovePanel (false);
         }
         currentPanel = panel;
         panel.Show ();
         if (panel is IPanel) {
             (panel as IPanel).BackEvent += BackClicked;
         }
         centralbox.PackStart (panel, true, true, 0);
         welcomepanel.Hide ();
     }
 }
开发者ID:GNOME,项目名称:longomatch,代码行数:19,代码来源:MainWindow.cs

示例13: UpdateContent

		public void UpdateContent ()
		{
			if (widget != null)
				((Gtk.Container)widget.Parent).Remove (widget);
			widget = item.Content;
			
			if (item.DrawFrame) {
				if (borderFrame == null) {
					borderFrame = new CustomFrame (1, 1, 1, 1);
					borderFrame.Show ();
					contentBox.Add (borderFrame);
				}
				if (widget != null) {
					borderFrame.Add (widget);
					widget.Show ();
				}
			}
			else if (widget != null) {
				if (borderFrame != null) {
					contentBox.Remove (borderFrame);
					borderFrame = null;
				}
				contentBox.Add (widget);
				widget.Show ();
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:26,代码来源:DockItemContainer.cs

示例14: OnComboVisualizersChanged

		protected virtual void OnComboVisualizersChanged (object sender, EventArgs e)
		{
			var button = (ToggleButton)sender;
			if (!button.Active) {//Prevent un-toggling
				button.Toggled -= OnComboVisualizersChanged;
				button.Active = true;
				button.Toggled += OnComboVisualizersChanged;
				return;
			}
			if (currentWidget != null)
				mainBox.Remove (currentWidget);
			foreach (var b in buttons) {
				if (b != button && b.Active) {
					b.Toggled -= OnComboVisualizersChanged;
					b.Active = false;
					b.Toggled += OnComboVisualizersChanged;
				}
			}
			currentVisualizer = visualizers [buttons.IndexOf (button)];
			currentWidget = currentVisualizer.GetVisualizerWidget (value);
			buttonSave.Sensitive = currentVisualizer.CanEdit (value);
			mainBox.PackStart (currentWidget, true, true, 0);
			currentWidget.Show ();
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:24,代码来源:ValueVisualizerDialog.cs

示例15: NewPreset

		private void NewPreset(IRenderer preset, Widget editor) {
			IDisposable old = this.mPreset as IDisposable;
			
			if (old != null) {
				this.InvokeOnRenderLoop(old.Dispose);
			}
			
			this.save.Sensitive = true;
			this.saveAs.Sensitive = true;
			this.mLastSave = null;
			
			this.mPreset = preset;
			this.mController.Renderer = preset;
			
			if (this.PresetPane.Child != null)
				this.PresetPane.Child.Destroy();
			
			editor.Show();
			this.PresetPane.Add(editor);
		}
开发者ID:Bamistro,项目名称:openvisualizationplatform,代码行数:20,代码来源:MainWindow.cs


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