本文整理汇总了C#中MainWindow.SetSizeRequest方法的典型用法代码示例。如果您正苦于以下问题:C# MainWindow.SetSizeRequest方法的具体用法?C# MainWindow.SetSizeRequest怎么用?C# MainWindow.SetSizeRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow.SetSizeRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
win.Show ();
win.SetSizeRequest(650, 800);
win.WindowPosition = WindowPosition.CenterAlways;
Application.Run ();
}
示例2: Main
public static void Main(string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
Gtk.Canvas canvas = new Gtk.Canvas ();
canvas.Engine.SetBackground (new Color (0.5, 0.5, 0.5));
win.Add (canvas);
BoxNode box = new BoxNode (new Color (1, 1, 1), 100, 100);
box.Draggable = true;
canvas.Root.Add (box);
PolygonNode poly = new PolygonNode (50, 50);
poly.Color = new Color (0, 0, 1);
poly.SetVerticies (new [] {
new Point (0, 1),
new Point (0, 0),
new Point (1, 0.5),
});
poly.Draggable = true;
canvas.Root.Add (poly);
LabelNode label = new LabelNode ("Label Node Test");
label.Color = new Color (1, 0, 0);
label.Draggable = true;
label.ClipInputToTextExtents = true;
canvas.Root.Add (label);
Random r = new Random ();
box.ActivatedEvent += (sender, e) => {
box.RotateTo (r.NextDouble () * 5);
};
ButtonNode button = new ButtonNode (new LabelNode ("Button"));
canvas.Root.Add (button);
button.MoveTo (300, 100);
win.SetSizeRequest (800, 200);
win.ShowAll ();
Application.Run ();
}