本文整理汇总了C#中Window.SetDefaultSize方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetDefaultSize方法的具体用法?C# Window.SetDefaultSize怎么用?C# Window.SetDefaultSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.SetDefaultSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main (string [] args)
{
Application.Init ();
if (args.Length <= 0) {
Console.WriteLine ("\nUSAGE: ImageBrowser.exe <directory>\n");
return;
}
string dir = args [0];
Window window = new Window ("Image Browser");
ScrolledWindow scroll = new ScrolledWindow ();//(new Adjustment (IntPtr.Zero), new Adjustment (IntPtr.Zero));
ArrayList images = GetItemsFromDirectory (dir);
Table table = PopulateTable (images);
window.Title = String.Format ("{0}: {1} ({2} images)", window.Title, dir, images.Count);
window.SetDefaultSize (300, 200);
//window.DeleteEvent += Window_Delete;
scroll.AddWithViewport (table);
//scroll.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
window.Add (scroll);
window.ShowAll ();
Application.Run ();
}
示例2: Main
public static int Main (string[] args)
{
Application.Init ();
Window win = new Window ("Viewport Tester");
win.SetDefaultSize (180, 50);
//win.DeleteEvent += new DeleteEventHandler (Window_Delete);
ScrolledWindow scroller = CreateViewport();
win.Add (scroller);
win.ShowAll ();
Application.Run ();
return 0;
}
示例3: SetUpGui
static void SetUpGui ()
{
Window w = new Window ("Scale Test");
VBox vbox = new VBox ();
HScale hscale = new HScale (1, 100, 10);
hscale.ValueChanged += hscale_value_changed_cb;
hscale.Value = 50;
scale_label = new Label (hscale.Value.ToString());
vbox.PackStart (scale_label, true, false, 0);
vbox.PackStart (hscale, true, false, 0);
w.Add (vbox);
w.SetDefaultSize (160, 120);
w.ShowAll ();
}
示例4: Main
//.........这里部分代码省略.........
MenuBar mb = new MenuBar();
vbx.PackStart (mb, false, false, 0);
MenuItem item = new MenuItem ("File");
Menu file_menu = new Menu ();
item.Submenu = file_menu;
MenuItem file_item = new MenuItem ("Open");
file_item.Activated += FileOpenHandler;
file_menu.Append (file_item);
file_item = new MenuItem ("Close");
file_menu.Append (file_item);
Menu close_menu = new Menu ();
file_item.Submenu = close_menu;
MenuItem close_menu_item = new MenuItem ("Close This");
close_menu.Append (close_menu_item);
close_menu_item = new MenuItem ("Close All");
close_menu.Append (close_menu_item);
file_item = new MenuItem ("Save");
file_menu.Append (file_item);
file_item = new MenuItem ("Save As");
file_menu.Append (file_item);
file_item = new MenuItem ("Quit");
file_item.Activated += FileQuitHandler;
file_menu.Append (file_item);
mb.Append (item);
item = new MenuItem ("Edit");
Menu edit_menu = new Menu ();
item.Submenu = edit_menu;
mb.Append (item);
item = new MenuItem ("About");
Menu about_menu = new Menu ();
item.Submenu = about_menu;
MenuItem about_item = new MenuItem ("Help");
about_item.Activated += AboutHelpHandler;
about_menu.Append (about_item);
about_item = new MenuItem ("Authors");
about_item.Activated += AboutAuthorsHandler;
about_menu.Append (about_item);
mb.Append (item);
HBox bx = new HBox ();
vbx.PackStart (bx);
bx.Spacing = 0;
Button l1 = new Button ("one");
Button l2 = new Button ("two");
Button l3 = new Button ("three");
Button l4 = new Button ("four");
Button l5 = new Button ("five");
l5.Clicked += Button_Clicked;
bx.PackStart(l1);
bx.PackStart(l2);
bx.PackStart(l3);
bx.PackStart(l4);
bx.PackStart(l5);
HBox inbox = new HBox ();
inbox.Spacing = 5;
inbox.BorderWidth = 2;
vbx.PackStart (inbox);
Label input_label = new Label ("What is your name?");
input_label.Xalign = 0;
inbox.PackStart (input_label, false, false, 0);
input = new Entry ();
inbox.PackStart (input);
HBox bbox = new HBox ();
Button get_text = new Button ("Get Text");
get_text.Clicked += Get_Text;
bbox.PackStart (get_text, false, false, 0);
vbx.PackStart (bbox, false, false, 0);
w.Add(vbx);
w.SetDefaultSize(300, 200);
w.ShowAll();
Application.Run();
}
示例5: TestScale
static void TestScale (object o, object eventargs)
{
Window w = new Window ("Scale Test");
VBox vbox = new VBox ();
HScale hscale = new HScale (1, 100, 10);
hscale.ValueChanged += TestScale_HscaleValueChanged;
hscale.Value = 50;
scale_label = new Label (hscale.Value.ToString());
vbox.PackStart (scale_label, true, false, 0);
vbox.PackStart (hscale, true, false, 0);
w.Add (vbox);
w.SetDefaultSize (160, 120);
w.ShowAll ();
}