本文整理汇总了C#中Gtk.HBox.ReorderChild方法的典型用法代码示例。如果您正苦于以下问题:C# HBox.ReorderChild方法的具体用法?C# HBox.ReorderChild怎么用?C# HBox.ReorderChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.HBox
的用法示例。
在下文中一共展示了HBox.ReorderChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SparkleDiffWindow
//.........这里部分代码省略.........
ViewLeft = new LeftRevisionView ();
ViewRight = new RightRevisionView ();
string output = process.StandardOutput.ReadToEnd ();
string [] revisions_info = Regex.Split (output.Trim (), "\n");
int i = 0;
foreach (string revision_info in revisions_info) {
string [] parts = Regex.Split (revision_info.Trim (), "\t");
int timestamp = int.Parse (parts [0]);
string author = parts [1];
string email = parts [2];
string date;
// TRANSLATORS: This is a format specifier according to System.Globalization.DateTimeFormatInfo
if (i == 0)
date = "Latest Revision";
else
date = String.Format (_("{0} at {1}"),
UnixTimestampToDateTime (timestamp).ToString (_("ddd MMM d, yyyy")),
UnixTimestampToDateTime (timestamp).ToString (_("H:mm")));
face_collection.AddFace (email);
ViewLeft.AddRow (face_collection.GetFace (email, 32), author, date);
ViewRight.AddRow (face_collection.GetFace (email, 32), author, date);
i++;
}
ViewLeft.SetImage (new RevisionImage (file_path, Revisions [1]));
ViewRight.SetImage (new RevisionImage (file_path, Revisions [0]));
ViewLeft.IconView.SelectionChanged += delegate {
ViewLeft.SetImage (new RevisionImage (file_path, Revisions [ViewLeft.GetSelected ()]));
ViewLeft.ScrolledWindow.Hadjustment = ViewRight.ScrolledWindow.Hadjustment;
ViewLeft.ScrolledWindow.Vadjustment = ViewRight.ScrolledWindow.Vadjustment;
HookUpViews ();
};
ViewRight.IconView.SelectionChanged += delegate {
ViewRight.SetImage (new RevisionImage (file_path, Revisions [ViewRight.GetSelected ()]));
ViewRight.ScrolledWindow.Hadjustment = ViewLeft.ScrolledWindow.Hadjustment;
ViewRight.ScrolledWindow.Vadjustment = ViewLeft.ScrolledWindow.Vadjustment;
HookUpViews ();
};
ViewLeft.ToggleButton.Clicked += delegate {
if (ViewLeft.ToggleButton.Active)
DetachViews ();
else
HookUpViews ();
};
ViewRight.ToggleButton.Clicked += delegate {
if (ViewLeft.ToggleButton.Active)
DetachViews ();
else
HookUpViews ();
};
layout_horizontal.PackStart (ViewLeft);
layout_horizontal.PackStart (ViewRight);
ResizeToViews ();
// Order time view according to the user's reading direction
if (Direction == Gtk.TextDirection.Rtl)
layout_horizontal.ReorderChild (ViewLeft, 1);
HookUpViews ();
HButtonBox dialog_buttons = new HButtonBox ();
dialog_buttons.Layout = ButtonBoxStyle.End;
dialog_buttons.BorderWidth = 0;
Button close_button = new Button (Stock.Close);
close_button.Clicked += delegate (object o, EventArgs args) {
Environment.Exit (0);
};
dialog_buttons.Add (close_button);
layout_vertical.PackStart (layout_horizontal, true, true, 0);
layout_vertical.PackStart (dialog_buttons, false, false, 0);
Add (layout_vertical);
}
示例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 ();
}