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


C# Gtk.Label.Destroy方法代码示例

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


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

示例1: FilterFontName

		public static string FilterFontName (string name)
		{
			if (name == "_DEFAULT_MONOSPACE")
				return DesktopService.DefaultMonospaceFont;
			if (name == "_DEFAULT_SANS") {
				var label = new Gtk.Label ("");
				string result = label.Style.FontDescription.Family + " " + ((int)label.Style.FontDesc.Size / Pango.Scale.PangoScale);
				label.Destroy ();
				return result;
			}
			
			return name;
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:13,代码来源:FontService.cs

示例2: LoadDefaults

		static void LoadDefaults ()
		{
			if (defaultMonospaceFont != null) {
				defaultMonospaceFont.Dispose ();
				defaultSansFont.Dispose ();
			}

			#pragma warning disable 618
			defaultMonospaceFontName = DesktopService.DefaultMonospaceFont;
			defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName);
			#pragma warning restore 618

			var label = new Gtk.Label ("");
			defaultSansFont = label.Style.FontDescription.Copy ();
			label.Destroy ();
			defaultSansFontName = defaultSansFont.ToString ();
		}
开发者ID:riverans,项目名称:monodevelop,代码行数:17,代码来源:FontService.cs

示例3: EnsureLayoutCreated

		void EnsureLayoutCreated (TextEditor editor)
		{
			if (editor.ColorStyle != null) {
				bool isError = errors.Any (e => e.IsError);
				
				string typeString = isError ? "error" : "warning";
				
				gc = (HslColor)(editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".text").Color);
				
				gcSelected = (HslColor)editor.ColorStyle.Selection.Color;
				
				gcLight = new Cairo.Color (1, 1, 1);
				
				
				colorMatrix[0, 0, 0, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".light.color1").Color);
				colorMatrix[0, 1, 0, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".light.color2").Color);
				
				colorMatrix[0, 0, 1, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".dark.color1").Color);
				colorMatrix[0, 1, 1, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".dark.color2").Color);
				
				colorMatrix[0, 0, 2, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".line.top").Color);
				colorMatrix[0, 1, 2, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble." + typeString + ".line.bottom").Color);
				
				colorMatrix[1, 0, 0, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".light.color1").Color);
				colorMatrix[1, 1, 0, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".light.color2").Color);
				
				colorMatrix[1, 0, 1, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".dark.color1").Color);
				colorMatrix[1, 1, 1, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".dark.color2").Color);
				
				colorMatrix[1, 0, 2, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".line.top").Color);
				colorMatrix[1, 1, 2, 0, 0] = Mono.TextEditor.Highlighting.Style.ToCairoColor (editor.ColorStyle.GetChunkStyle ("bubble.inactive." + typeString + ".line.bottom").Color);
				
				double factor = 1.03;
				for (int i = 0; i < 2; i++) {
					for (int j = 0; j < 2; j++) {
						for (int k = 0; k < 3; k++) {
							HslColor color = colorMatrix[i, j, k, 0, 0];
							color.L *= factor;
							colorMatrix[i, j, k, 1, 0] = color;
						}
					}
				}
				var selectionColor = Style.ToCairoColor (editor.ColorStyle.Selection.BackgroundColor);
				for (int i = 0; i < 2; i++) {
					for (int j = 0; j < 2; j++) {
						for (int k = 0; k < 3; k++) {
							for (int l = 0; l < 2; l++) {
								var color = colorMatrix[i, j, k, l, 0];
								colorMatrix[i, j, k, l, 1] = new Cairo.Color ((color.R + selectionColor.R * 1.5) / 2.5, (color.G + selectionColor.G * 1.5) / 2.5, (color.B + selectionColor.B * 1.5) / 2.5);
							}
						}
					}
				}
			}
			
			if (layouts != null)
				return;
			
			layouts = new List<LayoutDescriptor> ();
			fontDescription = Pango.FontDescription.FromString (editor.Options.FontName);
			var label = new Gtk.Label ("");
			fontDescription.Family = label.Style.FontDescription.Family;
			label.Destroy ();
			fontDescription.Size = (int)(fontDescription.Size * 0.9f * editor.Options.Zoom);
			foreach (ErrorText errorText in errors) {
				Pango.Layout layout = new Pango.Layout (editor.PangoContext);
				layout.FontDescription = fontDescription;
				layout.SetText (errorText.ErrorMessage);
				
				KeyValuePair<int, int> textSize;
				if (!textWidthDictionary.TryGetValue (errorText.ErrorMessage, out textSize)) {
					int w, h;
					layout.GetPixelSize (out w, out h);
					textSize = new KeyValuePair<int, int> (w, h);
					textWidthDictionary[errorText.ErrorMessage] = textSize;
				}
				layouts.Add (new LayoutDescriptor (layout, textSize.Key, textSize.Value));
			}
			
			if (errorCountLayout == null && errors.Count > 1) {
				errorCountLayout = new Pango.Layout (editor.PangoContext);
				errorCountLayout.FontDescription = fontDescription;
				errorCountLayout.SetText (errors.Count.ToString ());
			}
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:85,代码来源:MessageBubbleTextMarker.cs


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