本文整理汇总了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 ();
}
示例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);
}