本文整理汇总了C#中Gtk.Widget.Reparent方法的典型用法代码示例。如果您正苦于以下问题:C# Widget.Reparent方法的具体用法?C# Widget.Reparent怎么用?C# Widget.Reparent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Widget
的用法示例。
在下文中一共展示了Widget.Reparent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: init
private void init(Orientation orientation, Widget widget1, Widget widget2,bool initChildPaned)
{
Orientation = orientation;
// Gtk.Button bt = new Gtk.Button();
// bt.Label = "asd§";
// bt.Visible = true;
// Add(bt);
// paned = new Paned(Orientation);
// paned.Visible = true;
// Add(paned);
container1 = new Box(Orientation,0);
Pack1(container1,true,false);
container1.Expand = true;
container1.BorderWidth = 1;
if (initChildPaned)
{
container2 = new PanedBox(this, widget2);
Pack2(container2,true,false);
container2.Visible = true;
}
// if(widget2 == null)
// {
// paned.Visible = false;
// }
if ((container1 != null) && (widget1 != null))
{
widget1.Reparent(container1);
container1.PackStart(widget1,true,true,0);
container1.Visible = true;
}
//Add(paned);
}
示例2: Reparent
private void Reparent (Widget widget, HBox box, int index)
{
if (widget.Parent == box) {
return;
}
if (widget.Parent == null) {
box.PackStart (widget, false, false, 0);
} else {
widget.Reparent (box);
box.SetChildPacking (widget, false, false, 0, PackType.Start);
}
box.ReorderChild (widget, index);
widget.Show ();
}
示例3: AddItem
/// <summary>
/// Adds a new Widget to the box
/// </summary>
/// <param name='widget'>
/// Widget.
/// </param>
public void AddItem(Widget widget)
{
if (container1.Children.Length == 0)
{
//Console.WriteLine("panedbox: no children add: " + widget.Name + " widget: " + widget.Visible);
//Console.WriteLine("container1: " +container1.Visible);
if (widget.Parent != null)
{
widget.Reparent(container1); //TODO check if parent id not container1
}
if (!container1.Visible)
{
container1.Visible = true;
}
container1.PackStart(widget,true,true,0);
} else
{
//Console.WriteLine("have children");
PanedBox lb = getLastChild(this);
PanedBox newbox = new PanedBox(lb,widget);
lb.Append(newbox);
}
}