当前位置: 首页>>代码示例>>C#>>正文


C# Window.SetDefaultSize方法代码示例

本文整理汇总了C#中Gtk.Window.SetDefaultSize方法的典型用法代码示例。如果您正苦于以下问题:C# Window.SetDefaultSize方法的具体用法?C# Window.SetDefaultSize怎么用?C# Window.SetDefaultSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Window的用法示例。


在下文中一共展示了Window.SetDefaultSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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];

		Gtk.Window window = new Gtk.Window ("Image Browser");
		Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow (new Adjustment (IntPtr.Zero), new Adjustment (IntPtr.Zero));

		ArrayList images = GetItemsFromDirectory (dir);
		
		Gtk.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 ();
	}
开发者ID:emtees,项目名称:old-code,代码行数:27,代码来源:ImageBrowserGtk.cs

示例2: Create

		public static Gtk.Window Create ()
		{
			window = new Window ("GtkCombo");
			window.SetDefaultSize (200, 100);

			VBox box1 = new VBox (false, 0);
			window.Add (box1);

			VBox box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, true, true, 0);

			combo = new Gtk.Combo ();
			string[] pop = {"Foo", "Bar"};
			combo.PopdownStrings = pop;
			combo.Entry.Activated += new EventHandler (OnComboActivated);
			box2.PackStart (combo, true, true, 0);

			HSeparator separator = new HSeparator ();

			box1.PackStart (separator, false, false, 0);

			box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, false, false, 0);

			Button button = new Button (Stock.Close);
			button.Clicked += new EventHandler (OnCloseClicked);
			button.CanDefault = true;
			
			box2.PackStart (button, true, true, 0);
			button.GrabDefault ();
			return window;
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:34,代码来源:TestCombo.cs

示例3: Main

    public static void Main()
    {
        Application.Init();

        //-- Crear el interfaz
        Window w = new Window("Prueba");
        Button b1 = new Button("Test 1");
        Button b2 = new Button("Test 2");
        HBox h= new HBox();
        w.DeleteEvent += new DeleteEventHandler(Window_Delete);
        b1.Clicked += new EventHandler(Button_Clicked);
        b2.Clicked += new EventHandler(Button2_Clicked);

        h.PackStart(b1,false,false,0);
        h.PackStart(b2,false,false,0);

        w.Add(h);
        w.SetDefaultSize(100,100);
        w.ShowAll();

        //-- Inicializar chronopic
        cp = new Chronopic("/dev/ttyUSB0");

        //-- Inicializar otras cosas
        Cola = new Queue();

        //-- Inicializar temporizador
        GLib.Timeout.Add(100, new GLib.TimeoutHandler(Time_Out));

        Application.Run();
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:31,代码来源:test.cs

示例4: HeightMapSizeDialog

		public HeightMapSizeDialog( DoneCallback source )
		{
            this.source = source;

			window = new Window ("Heightmap width and height:");
			window.SetDefaultSize (200, 100);

            Table table = new Table( 3, 2, false );
            table.BorderWidth = 20;
            table.RowSpacing = 20;
            table.ColumnSpacing = 20;
            window.Add(table);

            table.Attach(new Label("Width:"), 0, 1, 0, 1);
            table.Attach(new Label("Height:"), 0, 1, 1, 2);

            widthcombo = new Combo();
            widthcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(widthcombo, 1, 2, 0, 1);

            heightcombo = new Combo();
            heightcombo.PopdownStrings = new string[]{"4","8","12","16","20","24","28","32"};
            table.Attach(heightcombo, 1, 2, 1, 2);

			Button button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (OnOkClicked);
			button.CanDefault = true;
			
            table.Attach(button, 1, 2, 2, 3);

            window.Modal = true;
            window.ShowAll();
		}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:33,代码来源:MainUI.cs

示例5: Main

    public static void Main()
    {
        BusG.Init ();
        Application.Init ();

        Button btn = new Button ("Click me");
        btn.Clicked += OnClick;

        VBox vb = new VBox (false, 2);
        vb.PackStart (btn, false, true, 0);

        Window win = new Window ("D-Bus#");
        win.SetDefaultSize (640, 480);
        win.Add (vb);
        win.Destroyed += delegate {Application.Quit ();};
        win.ShowAll ();

        bus = Bus.Session;

        string bus_name = "org.ndesk.gtest";
        ObjectPath path = new ObjectPath ("/org/ndesk/test");

        if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) {
            //create a new instance of the object to be exported
            demo = new DemoObject ();
            bus.Register (path, demo);
        } else {
            //import a remote to a local proxy
            demo = bus.GetObject<DemoObject> (bus_name, path);
        }

        //run the main loop
        Application.Run ();
    }
开发者ID:bl8,项目名称:dbus-sharp-glib,代码行数:34,代码来源:TestExport.cs

示例6: DemoMain

		public DemoMain ()
		{
			SetupDefaultIcon ();
		   	window = new Gtk.Window ("Gtk# Code Demos");
		   	window.SetDefaultSize (600, 400);
			window.DeleteEvent += new DeleteEventHandler (WindowDelete);

			HBox hbox = new HBox (false, 0);
			window.Add (hbox);

			treeView = CreateTree ();
			hbox.PackStart (treeView, false, false, 0);

			Notebook notebook = new Notebook ();
			hbox.PackStart (notebook, true, true, 0);

			notebook.AppendPage (CreateText (infoBuffer, false), new Label ("_Info"));
			TextTag heading = new TextTag ("heading");
			heading.Font = "Sans 18";
			infoBuffer.TagTable.Add (heading);

			notebook.AppendPage (CreateText (sourceBuffer, true), new Label ("_Source"));

			window.ShowAll ();
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:25,代码来源:DemoMain.cs

示例7: Main

    public static void Main()
    {
        BusG.Init ();
        Application.Init ();

        btn = new Button ("Click me");
        btn.Clicked += OnClick;

        VBox vb = new VBox (false, 2);
        vb.PackStart (btn, false, true, 0);

        Window win = new Window ("D-Bus#");
        win.SetDefaultSize (640, 480);
        win.Add (vb);
        win.Destroyed += delegate {Application.Quit ();};
        win.ShowAll ();

        bus = Bus.Session;

        string bus_name = "org.ndesk.gtest";
        ObjectPath path = new ObjectPath ("/org/ndesk/btn");

        if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) {
            bus.Register (path, btn);
            rbtn = btn;
        } else {
            rbtn = bus.GetObject<Button> (bus_name, path);
        }

        //run the main loop
        Application.Run ();
    }
开发者ID:bl8,项目名称:dbus-sharp-glib,代码行数:32,代码来源:TestUI.cs

示例8: Create

		public static Gtk.Window Create ()
		{
			window = new Window ("GtkComboBox");
			window.SetDefaultSize (200, 100);

			VBox box1 = new VBox (false, 0);
			window.Add (box1);

			VBox box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, true, true, 0);

			ComboBoxText combo = ComboBoxText.NewWithEntry ();
			combo.AppendText ("Foo");
			combo.AppendText ("Bar");
			combo.Changed += new EventHandler (OnComboActivated);
			combo.Entry.Changed += new EventHandler (OnComboEntryChanged);
			box2.PackStart (combo, true, true, 0);

			HSeparator separator = new HSeparator ();

			box1.PackStart (separator, false, false, 0);

			box2 = new VBox (false, 10);
			box2.BorderWidth = 10;
			box1.PackStart (box2, false, false, 0);

			Button button = new Button (Stock.Close);
			button.Clicked += new EventHandler (OnCloseClicked);
			button.CanDefault = true;
			
			box2.PackStart (button, true, true, 0);
			button.GrabDefault ();
			return window;
		}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:35,代码来源:TestComboBox.cs

示例9: Run

    public void Run(string[] args)
    {
        Application.Init ();
        PopulateStore ();
        store.SetSortColumnId(2, SortType.Ascending);

        Window win = new Window ("Gtk Widget Attributes");
        win.DeleteEvent += new DeleteEventHandler (DeleteCB);
        win.SetDefaultSize (640,480);

        ScrolledWindow sw = new ScrolledWindow ();
        win.Add (sw);

        TreeView tv = new TreeView (store);
        tv.HeadersVisible = true;

        tv.AppendColumn ("Name", new CellRendererText (), "markup", 0);
        tv.AppendColumn ("Type", new CellRendererText (), "text", 1);

        foreach(TreeViewColumn col in tv.Columns)
            col.Resizable = true;

        tv.SearchColumn = 2;

        sw.Add (tv);

        dialog.Destroy ();
        dialog = null;

        win.ShowAll ();

        Application.Run ();
    }
开发者ID:langpavel,项目名称:LPS-old,代码行数:33,代码来源:Main.cs

示例10: Main

    public static void Main()
    {
        BusG.Init ();
        Application.Init ();

        tv = new TextView ();
        ScrolledWindow sw = new ScrolledWindow ();
        sw.Add (tv);

        Button btn = new Button ("Click me");
        btn.Clicked += OnClick;

        Button btnq = new Button ("Click me (thread)");
        btnq.Clicked += OnClickQuit;

        VBox vb = new VBox (false, 2);
        vb.PackStart (sw, true, true, 0);
        vb.PackStart (btn, false, true, 0);
        vb.PackStart (btnq, false, true, 0);

        Window win = new Window ("D-Bus#");
        win.SetDefaultSize (640, 480);
        win.Add (vb);
        win.Destroyed += delegate {Application.Quit ();};
        win.ShowAll ();

        bus = Bus.Session.GetObject<IBus> ("org.freedesktop.DBus", new ObjectPath ("/org/freedesktop/DBus"));

        Application.Run ();
    }
开发者ID:bl8,项目名称:dbus-sharp-glib,代码行数:30,代码来源:TestThreads.cs

示例11: Main

    public static void Main()
    {
        BusG.Init ();
        Application.Init ();

        Window win = new Window ("D-Bus#");
        win.SetDefaultSize (640, 480);
        win.Destroyed += delegate {Application.Quit ();};
        win.ShowAll ();

        bus = Bus.Session;
        sysBus = Bus.System.GetObject<IBus> ("org.freedesktop.DBus", new ObjectPath ("/org/freedesktop/DBus"));

        string bus_name = "org.ndesk.gtest";
        ObjectPath path = new ObjectPath ("/org/ndesk/test");

        if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) {
            //create a new instance of the object to be exported
            demo = new DemoObject ();
            sysBus.NameOwnerChanged += demo.FireChange;
            bus.Register (path, demo);
        } else {
            //import a remote to a local proxy
            demo = bus.GetObject<DemoObject> (bus_name, path);
        }

        //run the main loop
        Application.Run ();
    }
开发者ID:bl8,项目名称:dbus-sharp-glib,代码行数:29,代码来源:TestSystemBus.cs

示例12: CategoriaListView

        public CategoriaListView()
        {
            TreeViewHelper t=new TreeViewHelper(treeView,"Select * from categoria");
            Gtk.Action refreshAction = new Gtk.Action("refreshAction", null, null, Stock.Refresh);
            //tengo acceso al actionGroup de IEntityListView
            actionGroup.Add(refreshAction);
            refreshAction.Activated += delegate {t.Refresh ();};
            Gtk.Action editAction = new Gtk.Action("editAction", null, null, Stock.Edit);
            actionGroup.Add(editAction);
            editAction.Activated += delegate {
                Window ventana=new Window("Editar");
                ventana.SetDefaultSize(500,500);
                VBox h=new VBox(true,10);
                ventana.Add (h);
                Label enunciado=new Label("Introduce el nuevo valor:");
                h.Add (enunciado);
                Entry caja=new Entry();
                h.Add (caja);
                Button b=new Button("Editar");
                h.Add (b);
                b.Clicked+=delegate
                {
                    IDbCommand dbCommand=App.Instance.DbConnection.CreateCommand();
                    dbCommand.CommandText =
                    string.Format ("update categoria set nombre='{1}' where id={0}", t.Id,caja.Text);
                    dbCommand.ExecuteNonQuery ();
                };

                ventana.ShowAll();

            };
        }
开发者ID:ruben206,项目名称:ad,代码行数:32,代码来源:CategoriaListView.cs

示例13: TabbedSkin

		public TabbedSkin(BasilProject project, ITaskBuilder taskBuilder)
		{
			_project = project;
			_tabsToTools = new System.Collections.Hashtable();

			window = new Gtk.Window ("WeSay");
			window.SetDefaultSize (600, 400);
			window.DeleteEvent += new DeleteEventHandler (WindowDelete);

			HBox hbox = new HBox (false, 0);
			window.Add (hbox);

			Notebook notebook = new Notebook ();
			notebook.SwitchPage += new SwitchPageHandler(OnNotebookSwitchPage);
			hbox.PackStart(notebook, true, true, 0);
			foreach (ITask t in taskBuilder.Tasks)
			{
				VBox container = new VBox();
				t.Container = container;
				int i = notebook.AppendPage(container, new Label(t.Label));
				_tabsToTools.Add(i, t);
			}

			window.ShowAll ();
		}
开发者ID:bbriggs,项目名称:wesay,代码行数:25,代码来源:TabbedSkin.cs

示例14: Gui

    // Constructor
    public Gui()
    {
        Application.Init();

        ioh = new IoHandler();
        win = new Window("Drawing lines");
        darea = new  DrawingArea();
        painter = new DrawShape(DrawLine);
        listenOnMouse = false; // Við hlustum ekki á mús við núllstöðu.

        // Aukum viðburðasett teikniborðs með ,möskum'.
        darea.AddEvents(
                (int)Gdk.EventMask.PointerMotionMask
                | (int)Gdk.EventMask.ButtonPressMask
                | (int)Gdk.EventMask.ButtonReleaseMask);

        // Úthlutum virkni á viðburði.
        win.Hidden += delegate {Application.Quit();};
        win.KeyPressEvent += onKeyboardPressed;
        darea.ExposeEvent += onDrawingAreaExposed;
        darea.ButtonPressEvent += onMouseClicked;
        darea.ButtonReleaseEvent += onMouseReleased;
        darea.MotionNotifyEvent += onMouseMotion;

        // Grunnstillum stærð glugga.
        win.SetDefaultSize(500,500);

        // Lokasamantekt til að virkja glugga.
        win.Add(darea);
        win.ShowAll();
        Application.Run();
    }
开发者ID:Bangsadrengur,项目名称:Teikniforrit,代码行数:33,代码来源:Gui.cs

示例15: Main

	public static void Main(string[] args) {
		Opts options = new Opts();
		options.ProcessArgs(args);
		
		if (options.RemainingArguments.Length < 2) {
			options.DoHelp();
			return;
		}
		
		Application.Init ();
		
		Window win = new Window("NDiff");
		win.DeleteEvent += new DeleteEventHandler(Window_Delete);
		win.SetDefaultSize(800, 600);
		
		DiffWidget.Options dopts = new DiffWidget.Options();
		dopts.SideBySide = options.sidebyside;

		if (options.RemainingArguments.Length == 2) {
			dopts.LeftName = options.RemainingArguments[0];
			dopts.RightName = options.RemainingArguments[1];
			Diff diff = new Diff(options.RemainingArguments[0], options.RemainingArguments[1], options.caseinsensitive, true);
			win.Add(new DiffWidget(diff, dopts));
		} else {
			Diff[] diffs = new Diff[options.RemainingArguments.Length-1];
			for (int i = 0; i < options.RemainingArguments.Length-1; i++)
				diffs[i] = new Diff(options.RemainingArguments[0], options.RemainingArguments[i+1], options.caseinsensitive, true);
			Merge merge = new Merge(diffs);
			win.Add(new DiffWidget(merge, dopts));
		}		

		win.ShowAll();
		Application.Run();
	}
开发者ID:xxjeng,项目名称:nuxleus,代码行数:34,代码来源:NDiff.cs


注:本文中的Gtk.Window.SetDefaultSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。