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


C# TextView.AddChildAtAnchor方法代码示例

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


在下文中一共展示了TextView.AddChildAtAnchor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: RecursiveAttach

		private void RecursiveAttach (int depth, TextView view, TextChildAnchor anchor)
		{
			if (depth > 4)
				return;

			TextView childView = new TextView (view.Buffer);

			// Event box is to add a black border around each child view
			EventBox eventBox = new EventBox ();
			Gdk.Color color = new Gdk.Color ();
			Gdk.Color.Parse ("black", ref color);
			eventBox.ModifyBg (StateType.Normal, color);

			Alignment align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
			align.BorderWidth = 1;

			eventBox.Add (align);
			align.Add (childView);

			view.AddChildAtAnchor (eventBox, anchor);

			RecursiveAttach (depth+1, childView, anchor);
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:23,代码来源:DemoTextView.cs


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