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


C# Label.Show方法代码示例

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


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

示例1: GetVisualizerWidget

		public override Control GetVisualizerWidget (ObjectValue val)
		{
			string value = val.Value;
			Gdk.Color col = new Gdk.Color (85, 85, 85);

			if (!val.IsNull && (val.TypeName == "string" || val.TypeName == "char[]"))
				value = '"' + GetString (val) + '"';
			if (DebuggingService.HasInlineVisualizer (val))
				value = DebuggingService.GetInlineVisualizer (val).InlineVisualize (val);

			var label = new Gtk.Label ();
			label.Text = value;
			var font = label.Style.FontDescription.Copy ();

			if (font.SizeIsAbsolute) {
				font.AbsoluteSize = font.Size - 1;
			} else {
				font.Size -= (int)(Pango.Scale.PangoScale);
			}

			label.ModifyFont (font);
			label.ModifyFg (StateType.Normal, col);
			label.SetPadding (4, 4);

			if (label.SizeRequest ().Width > 500) {
				label.WidthRequest = 500;
				label.Wrap = true;
				label.LineWrapMode = Pango.WrapMode.WordChar;
			} else {
				label.Justify = Gtk.Justification.Center;
			}

			if (label.Layout.GetLine (1) != null) {
				label.Justify = Gtk.Justification.Left;
				var line15 = label.Layout.GetLine (15);
				if (line15 != null) {
					label.Text = value.Substring (0, line15.StartIndex).TrimEnd ('\r', '\n') + "\n…";
				}
			}

			label.Show ();

			return label;
		}
开发者ID:michaelc37,项目名称:monodevelop,代码行数:44,代码来源:GenericPreviewVisualizer.cs

示例2: Category

		public Category (Tiles.TileGroupInfo info, int columns)
		{
			WidgetFlags |= WidgetFlags.NoWindow;

			header = new Gtk.HBox (false, 0);

			headerExpander = new Gtk.Expander ("<big><b>" + GLib.Markup.EscapeText (info.Name) + "</b></big>");
			((Gtk.Label) headerExpander.LabelWidget).SetAlignment (0.0f, 0.5f);
			headerExpander.UseMarkup = true;
			headerExpander.UseUnderline = true;
			headerExpander.Show ();
			header.PackStart (headerExpander, true, true, 0);

			headerExpander.Activated += OnActivated;
			
			scope = Tiles.Utils.TileGroupToScopeType(info.Group);
			
			position = new Gtk.Label ();
			position.ModifyFg (Gtk.StateType.Normal, position.Style.Base (Gtk.StateType.Selected));
			header.PackStart (position, false, false, 0);
			position.Show ();

			prev = MakeButton (header, Gtk.Stock.GoBack, OnPrev);
			next = MakeButton (header, Gtk.Stock.GoForward, OnNext);

			header.Show ();
			header.Parent = this;
			header.SizeRequested += HeaderSizeRequested;

			tiles = new SortedTileList (Beagle.Search.SortType.Relevance);
			Columns = columns;

			UpdateButtons ();
			Expanded = true;	
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:35,代码来源:Category.cs

示例3: UnknownEditor

		public UnknownEditor(object @object, PropertyInfo info) : base(@object, info) {
			Label l = new Label("Cannot edit property of type " +
			                    info.PropertyType.FullName);
			l.Show();
			
			this.Add(l);
		}
开发者ID:Bamistro,项目名称:openvisualizationplatform,代码行数:7,代码来源:UnknownEditor.cs

示例4: GlToggleButton

        public GlToggleButton(GdkGL.Config config)
        {
            // VBox.
            VBox vbox = new VBox (false, 0);
            vbox.BorderWidth = 10;

            // Drawing area for drawing OpenGL scene.
            DrawingArea drawing_area = new DrawingArea ();
            drawing_area.SetSizeRequest (200, 200);

            // Set OpenGL-capability to the widget.
            m_gl = new GlWidget (drawing_area, config);
            drawing_area.Realized += new EventHandler (Realize);
            drawing_area.ConfigureEvent += new ConfigureEventHandler (Configure);
            drawing_area.ExposeEvent += new ExposeEventHandler (Expose);
            drawing_area.Unrealized += new EventHandler (Unrealize);
            drawing_area.VisibilityNotifyEvent += new VisibilityNotifyEventHandler (VisibilityNotify);

            vbox.PackStart (drawing_area, true, true, 0);
            drawing_area.Show ();

            // Label.
            Label label = new Label ("Toggle Animation");
            vbox.PackStart (label, false, false, 10);
            label.Show ();

            Toggled += new EventHandler (ToggleAnimation);

            // Add VBox.
            vbox.Show ();
            Add (vbox);
        }
开发者ID:GNOME,项目名称:gtkglext-sharp,代码行数:32,代码来源:button.cs

示例5: BuildLayout

        void BuildLayout ()
        {
            primary_vbox = new VBox ();
            
            var label = new Label ("Super duper test UI!");
            label.Show ();
            primary_vbox.Add (label);
            
            var button_box = new HButtonBox ();
            button_box.Show ();
            primary_vbox.Add (button_box);
            
            var folder_button = new FileChooserButton ("Select import folder", FileChooserAction.SelectFolder);
            folder_button.FileSet += delegate {
                folder = folder_button.Uri;
                Log.Information ("Selected " + folder);
            };
            folder_button.Show ();
            button_box.Add (folder_button);
            
            var import_button = new Button { Label = "Start Import" };
            import_button.Activated += StartImport;
            import_button.Clicked += StartImport;
            import_button.Show ();
            button_box.Add (import_button);

            primary_vbox.Show ();
            Add (primary_vbox);
        }
开发者ID:tigger,项目名称:tripod,代码行数:29,代码来源:MainWindow.cs

示例6: NewSearchPage

        public NewSearchPage()
            : base(0.5f, 0.5f, 0f, 0f)
        {
            base.SetPadding(36, 36, 36, 36);
            base.FocusGrabbed += base_FocusGrabbed;

            mainVBox = new VBox();

            Label label = new Label();
            label.Xalign = 0;
            label.Markup = "<span size=\"x-large\" weight=\"bold\">Search for files...</span>";
            mainVBox.PackStart(label, false, false, 0);
            label.Show();

            searchEntry = new FileSearchEntry();
            searchEntry.WidthRequest = 400;
            mainVBox.PackStart(searchEntry, false, false, 6);
            searchEntry.Show();

            searchButton = new Button("_Search");
            searchButton.Image = new Image(Stock.Find, IconSize.Button);
            searchButton.Clicked += searchButton_Clicked;
            searchButton.Show();

            HButtonBox buttonBox = new HButtonBox();
            buttonBox.Layout = ButtonBoxStyle.End;
            buttonBox.PackStart(searchButton, false, false, 0);
            mainVBox.PackStart(buttonBox, false, false, 0);
            buttonBox.Show();

            base.Add(mainVBox);
            mainVBox.Show();
        }
开发者ID:codebutler,项目名称:meshwork,代码行数:33,代码来源:NewSearchPage.cs

示例7: TitledList

        public TitledList(string title_str)
            : base()
        {
            genre_map = new Dictionary<string, Genre> ();
            title = new Label ();
            title.Xalign = 0;
            title.Ellipsize = Pango.EllipsizeMode.End;
            title.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (title_str));

            PackStart (title, false, false, 0);
            title.Show ();

            StyleSet += delegate {
                title.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                title.ModifyFg (StateType.Normal, Style.Text (StateType.Normal));
            };

            tile_view = new TileView (2);
            PackStart (tile_view, true, true, 0);
            tile_view.Show ();

            StyleSet += delegate {
                tile_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
                tile_view.ModifyFg (StateType.Normal, Style.Base (StateType.Normal));
            };
        }
开发者ID:nailyk,项目名称:banshee-community-extensions,代码行数:26,代码来源:Widgets.cs

示例8: EnableStartupNotesPreference

		public EnableStartupNotesPreference ()
		{
			IPropertyEditorBool enableStartupNotes_peditor;
			Gtk.CheckButton enableStartupNotesCheckbox;
			Gtk.Label enableStartupNotesLabel;

			// Enable Startup Notes option
			enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
			enableStartupNotesLabel.UseMarkup = true;
			enableStartupNotesLabel.Justify = Gtk.Justification.Left;
			enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
			enableStartupNotesLabel.Show ();

			enableStartupNotesCheckbox = new Gtk.CheckButton ();
			enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
			enableStartupNotesCheckbox.Show ();

			enableStartupNotes_peditor =
				Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
			Preferences.Get (enableStartupNotes_peditor.Key);
			enableStartupNotes_peditor.Setup ();

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (enableStartupNotesCheckbox);
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:26,代码来源:EnableStartupNotesPreference.cs

示例9: AudioView

        public AudioView()
        {
            //			this.WidthRequest = 500; //250;
            //			this.HeightRequest = 375; //187;

            Frame frame = new Frame();
            frame.BorderWidth = 5;
            frame.Show();

            VBox vbox = new VBox(false, 0);
            frame.Add(vbox);
            vbox.Show();

            Label label = new Label(Catalog.GetString("Audio Chat in progress..."));

            label.Show();
            vbox.PackStart(label, false, true, 5);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseAudioClicked;
            button.Show();
            vbox.PackStart(button, false, true, 5);

            this.Add(frame);
        }
开发者ID:GNOME,项目名称:banter,代码行数:25,代码来源:AudioView.cs

示例10: NotebookTabLabel

        public NotebookTabLabel(string title)
        {
            Button button = new Button ();
            button.Image = new Gtk.Image (Stock.Close, IconSize.Menu);
            button.TooltipText = "Close Tab";
            button.Relief = ReliefStyle.None;

            RcStyle rcStyle = new RcStyle ();
            rcStyle.Xthickness = 0;
            rcStyle.Ythickness = 0;
            button.ModifyStyle (rcStyle);

            button.FocusOnClick = false;
            button.Clicked += OnCloseClicked;
            button.Show ();

            Label label = new Label (title);
            label.UseMarkup = false;
            label.UseUnderline = false;
            label.Show ();

            HBox hbox = new HBox (false, 0);
            hbox.Spacing = 0;
            hbox.Add (label);
            hbox.Add (button);
            hbox.Show ();

            this.Add (hbox);
        }
开发者ID:alpinechough,项目名称:monocov,代码行数:29,代码来源:NotebookTabLabel.cs

示例11: ToolBarLabel

		public ToolBarLabel (string text)
		{
			Label l = new Label (text);
			l.Show ();
			
			Add (l);
			Show ();
		}
开发者ID:RudoCris,项目名称:Pinta,代码行数:8,代码来源:ToolBarLabel.cs

示例12: CreateColorBox

 private Widget CreateColorBox(string name, Gdk.Color color)
 {
     EventBox eb = new EventBox();
        eb.ModifyBg(StateType.Normal, color);
        Label l = new Label(name);
        eb.Add(l);
        l.Show();
        return eb;
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:9,代码来源:iFolderWindow.cs

示例13: GetPreferenceTabWidget

		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
开发者ID:oluc,项目名称:tomboy,代码行数:56,代码来源:AdvancedPreferencesAddin.cs

示例14: CreateLabel

 private Label CreateLabel (string value)
 {
     Label label = new Label ();
     label.Xalign = 1.0f;
     label.Markup = String.Format ("<small>{0}</small>", GLib.Markup.EscapeText (value));
     label.ModifyFg (StateType.Normal, Hyena.Gui.GtkUtilities.ColorBlend (
         Style.Foreground (StateType.Normal), Style.Background (StateType.Normal)));
     label.Show ();
     return label;
 }
开发者ID:haugjan,项目名称:banshee-hacks,代码行数:10,代码来源:EqualizerLevelsBox.cs

示例15: CreateLabel

 private Label CreateLabel(string value)
 {
     Label label = new Label ();
     label.Xalign = 1.0f;
     label.Markup = String.Format ("<small>{0}</small>", GLib.Markup.EscapeText (value));
     label.OverrideColor (StateFlags.Normal, Hyena.Gui.GtkUtilities.ColorBlend (
         StyleContext.GetColor (StateFlags.Normal), StyleContext.GetBackgroundColor (StateFlags.Normal)));
     label.Show ();
     return label;
 }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:10,代码来源:EqualizerLevelsBox.cs


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