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


C# Window.Resize方法代码示例

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


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

示例1: Main

    public static void Main(string[] args)
    {
        Gtk.Window window;
          EventBox eventbox;
          Label label;

          Application.Init();

          window = new Gtk.Window ("Eventbox");
          window.DeleteEvent += new DeleteEventHandler (delete_event);

          window.BorderWidth = 10;
          window.Resize(400,300);

          eventbox = new EventBox ();
          window.Add (eventbox);
          eventbox.Show();

          label = new Label ("Click here to quit");
          eventbox.Add(label);
          label.Show();

          label.SetSizeRequest(110, 20);

          eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);

          eventbox.Realize();

          window.Show();

          Application.Run();
    }
开发者ID:BackupTheBerlios,项目名称:genaro,代码行数:32,代码来源:eventBox.cs

示例2: Main

    public static void Main(string[] args)
    {
        Application.Init();

        //Create the Window
        Window myWin = new Window("GtkSpell# Sample App");
        myWin.Resize(200,200);

        //Create a TextView
        TextView myTextView = new TextView();

        SpellCheck mySpellCheck;

        //Bind GtkSpell to our textview
        if (args.Length > 0)
          mySpellCheck = new SpellCheck(myTextView, args[0]);
        else
          mySpellCheck = new SpellCheck(myTextView, "en-us");

        //spellCheck.Detach();
        //spellCheck.();

        //Add the TextView to the form
        myWin.Add(myTextView);

        //Show Everything
        myWin.ShowAll();

        myWin.DeleteEvent += new DeleteEventHandler(delete);

        Application.Run();
    }
开发者ID:mono,项目名称:gtkspell-sharp,代码行数:32,代码来源:TestGtkSpell.cs

示例3: RunIt

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

            // Create the Window
            window = new Gtk.Window("Memorize");
            window.DeleteEvent += delegate { Application.Quit(); };
            window.Resize(800, 600);

            // Status bar ...
            icon = new StatusIcon(new Pixbuf("res/icon.png"));
            icon.Visible = true;
            icon.Activate += delegate { window.Visible = !window.Visible; };
            icon.Tooltip = "Yo imma let you finish";

            // Table view
            Table table1 = new Table(2, 2, false);
            Label top = new Label();
            top.Text = "Buttons shortcuts, statuses, etc...";
            Label bottomLeft= new Label();
            bottomLeft.Text = "A \"cardboard\" of memos will be hung here.";
            Label bottomRight = new Label();
            bottomRight.Text = "Menu for creating memo \nlists, projects, memos...";

            // Here I could attach some informations, buttons
            // something that is general to all memos ?
            table1.Attach(top, 0, 2, 0, 1, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Fill, 10, 10);

            // Here I would create a specific widget that specializes
            // in displaying memos
            /*
            BoardDisplay mBoard = new BoardDisplay();
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("1", "one")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("2", "two")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("3", "three is an incredibly long text blah blah blah")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("4", "four")));
            mBoard.DrawBoard();
            table1.Attach(mBoard.Board, 0, 1, 1, 2, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Expand, 10, 10);
            */
            // Ideally here I would attach something that inherits a widget
            // and is a menu for creating new memos
            table1.Attach(bottomRight, 1, 2, 1, 2, Gtk.AttachOptions.Fill,
                    Gtk.AttachOptions.Fill, 1, 1);

            window.Add(table1);
            window.ShowAll();
            Application.Run();
        }
开发者ID:tomgud,项目名称:Memorize,代码行数:50,代码来源:Application.cs

示例4: Main

	static void Main ()
	{		
		Application.Init ();
		Gtk.Window w = new Gtk.Window ("Mono.Cairo Circles demo");

		a = new CairoGraphic ();	
		
		Box box = new HBox (true, 0);
		box.Add (a);
		w.Add (box);
		w.Resize (500,500);		
		w.ShowAll ();		
		
		Application.Run ();
	}
开发者ID:nlhepler,项目名称:mono,代码行数:15,代码来源:arc.cs

示例5: Main

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

        Button button = new Button ("Test");
        button.Clicked += new EventHandler (ButtonClickedHandler);

        Window myWin = new Window ("GTK# Test Application");
        myWin.Add (button);
        myWin.Resize (400, 250);
        myWin.DeleteEvent += WindowDeleteEventHandler;
        myWin.ShowAll ();

        Application.Run ();
    }
开发者ID:Sanva,项目名称:test-glib-idle-add,代码行数:15,代码来源:test-glib-idle-add.cs

示例6: Start

        public void Start()
        {
            currentStep = 0;

            window = new Window(WindowType.Toplevel);
            window.Move(10, 10);
            window.KeepAbove = true;
            window.Resize(400, 30);
            window.AcceptFocus = false;
            window.Title = "Progress Bar";

            progressBar = new ProgressBar();
            progressBar.Fraction = 0;

            window.Add(progressBar);
            window.ShowAll();
        }
开发者ID:JacquesLucke,项目名称:Collage,代码行数:17,代码来源:ProgressBarWindow.cs

示例7: Main

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

        //Create the Window
        Window myWin = new Window("My First GTK# Application");
        myWin.Resize(200,200);

        //Create a label and put some text in it.
        Label myLabel = new Label();
        myLabel.Text = "Hello World!!!";

        //add the label to the form
        myWin.Add(myLabel);
        myWin.ShowAll();
        Application.Run();
    }
开发者ID:Jimmyscene,项目名称:Random,代码行数:17,代码来源:HelloWorld.cs

示例8: Main

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

        // creating components
        Window myWin = new Window("My First Gtk# Application");
        Label myLabel = new Label();

        myWin.Resize(200,200);
        myLabel.Text = "Hello World";
        myWin.Add(myLabel);

        // event handlers
        //		myWin.DeleteEvent += new DeleteEventHandler(Window_Delete);
        myWin.DeleteEvent += Window_Delete;

        myWin.ShowAll();

        Application.Run();
    }
开发者ID:cakyus,项目名称:learn-mono,代码行数:20,代码来源:GtkHello.cs

示例9: Main

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

                    // Set up a button object.
                        Button btn = new Button ("Hello World");
                        // when this button is clicked, it'll run hello()
                        btn.Clicked += new EventHandler (hello);

                        Window window = new Window ("helloworld");
            window.Resize(400,300);
                    // when this window is deleted, it'll run delete_event()
                        window.DeleteEvent += delete_event;

                    // Add the button to the window and display everything
                    window.Add (btn);
                        window.ShowAll ();

                        Application.Run ();
    }
开发者ID:BackupTheBerlios,项目名称:genaro,代码行数:20,代码来源:helloGtk.cs

示例10: Main

        public static void Main(string[] args)
        {
            Application.Init();

                        /* Create a new window */
                        Window window = new Window ("Pixmap'd Buttons!");

                        /* It's a good idea to do this for all windows. */
                        window.DeleteEvent += delete_event;

                        /* Sets the border width of the window. */
                        window.BorderWidth = 10;

            window.Resize(400,300);

                        /* Create a new button */
                        Button button = new Button();

                        /* Connect the "clicked" signal of the button to our callback */
                        button.Clicked += callback;

                        /* This calls our box creating function */
                        Widget box = xpm_label_box ("info.xpm", "cool button");

                        /* Pack and show all our widgets */
                        box.Show();

                        button.Add(box);

                        button.Show();

                        window.Add(button);

                        window.ShowAll();

                        /* Rest in gtk_main and wait for the fun to begin! */
                        Application.Run();
        }
开发者ID:BackupTheBerlios,项目名称:genaro,代码行数:38,代码来源:boton_imagen.cs

示例11: Main

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

            //Create the new window
            Window myWindow = new Window ("");
            myWindow.Resize (300, 300);
            myWindow.SetPosition (WindowPosition.Center);
            myWindow.ModifyBg (StateType.Normal, new Gdk.Color (174, 229, 218));

            //Creamos una etiqueta

            Label label = new Label ();
            label.Text = "Mi 1.º aplicación con GTK";

            //Añadimos la etiqueta al formulario
            myWindow.Add (label);

            //Ver todo
            myWindow.ShowAll ();

            Application.Run ();
        }
开发者ID:miguelangelrosales,项目名称:AD,代码行数:23,代码来源:Program.cs

示例12: Main

        public static void Main(string[] args)
        {
            Application.Init();

            //Create the Window
            Window myWin = new Window("My first GTK# Application! ");
            myWin.Resize(500,500);

            myLabel = new Label();
            userInputField = new TextView();

            Button runCommand = new Button("run_command");
            runCommand.Clicked += HandleRunCommandClicked;

            MenuBar mainBar = new MenuBar();
            MenuItem exitItem = new MenuItem("File");

            MenuBar subMenu = new MenuBar();
            MenuItem subItem = new MenuItem("File");

            subMenu.Add(subItem);
            mainBar.Add(exitItem);

            VBox testBox = new VBox(false, 3);

            testBox.PackStart(mainBar);
            testBox.PackStart(userInputField);
            testBox.PackStart(myLabel);
            testBox.PackStart(runCommand);

            myWin.Add(testBox);

            //Show Everything
            myWin.ShowAll();

            Application.Run();
        }
开发者ID:OshinKaramian,项目名称:nosql-management-studio,代码行数:37,代码来源:Main.cs

示例13: Main

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

                Window win = new Window ("Test");
                win.Resize (200, 200);

                Label label = new Label ();
                label.Text = "Hello, world!";

                win.Add (label);

                ApplicationIndicator indicator = new ApplicationIndicator ("Example",
                                                                           "applications-microblogging-panel",
                                                                           AppIndicatorCategory.ApplicationStatus);

                indicator.AppIndicatorStatus = AppIndicatorStatus.Attention;

                Menu menu = new Menu ();
                var foo = new MenuItem ("Foo");
                menu.Append (foo);
                foo.Activated += delegate {
                        System.Console.WriteLine ("Foo item has been activated");
                };

                menu.Append (new MenuItem ("Bar"));

                indicator.Menu = menu;
                indicator.Menu.ShowAll ();

                indicator.SecondaryActivateTarget = foo;

                win.ShowAll ();

                Application.Run ();
    }
开发者ID:ArcticaProject,项目名称:libayatana-appindicator,代码行数:36,代码来源:AyatanaIndicatorExample.cs

示例14: GnomeArtNgApp

    public GnomeArtNgApp(string[] args)
    {
        Application.Init();
        //i18n
        Catalog.Init("gnomeartng","./locale");
        config=new CConfiguration();
        //initialize Glade
        string mainW = "MainWindow";
        Glade.XML gxml = new Glade.XML (null, "gui.glade", mainW, null);
        mainWindow = (Gtk.Window) gxml.GetWidget (mainW);
        gxml.Autoconnect (this);

        //Connect all events
        mainWindow.DeleteEvent+=new DeleteEventHandler(OnWindowDeleteEvent);
        ExtInfoPreviewButton.Clicked += new EventHandler(OnPreviewButtonClicked);
        InstallButton.Clicked  += new EventHandler(OnInstallButtonClicked);
        RevertButton.Clicked  += new EventHandler(OnRevertButtonClicked);
        RefreshButton.Clicked += new EventHandler(OnRefreshButtonClicked);
        SaveButton.Clicked  += new EventHandler(OnSaveButtonClicked);
        MainNotebook.SwitchPage += new SwitchPageHandler(OnSwitchPage);
        FilterEntry.Changed += new EventHandler(OnFilterEntriesChanged);
        //		SortKindCb.Changed += new EventHandler(OnSortKindEntryChanged);
        //		SortDirectionCb.Changed += new EventHandler(OnSortDirectionEntryChanged);
        //		SortCloseButton.Clicked += new EventHandler(OnSortCloseClicked);
        FilterEntry.KeyReleaseEvent += new KeyReleaseEventHandler(OnFilterbarKeyReleased);
        FilterCloseButton.Clicked += new EventHandler(OnFilterbarCloseClicked);

        //Menuitems
        QuitMenuItem.Activated += new EventHandler(OnQuitItemSelected);
        UpdateMenuItem.Activated += new EventHandler(OnUpdateItemSelected);
        DonateMenuItem.Activated += new EventHandler(CUpdateWindow.onDonateButtonClicked);
        FilterMenuItem.Activated += new EventHandler(OnFilterItemSelected);
        //		SortMenuItem.Activated += new EventHandler(OnSortItemSelected);
        InfoMenuItem.Activated += new EventHandler(OnInfoItemSelected);
        PreferencesMenuItem.Activated += new EventHandler(OnPreferencesItemSelected);
        FTAItem.Activated += new EventHandler(onFtaItemSelected);

        //First, download all thumbs...but don't bother the user with the update message, even if there is one
        bool RestartApp= false;
        if (config.NeverStartedBefore)
            new CFirstTimeAssistant(config);
        else if (config.DontBotherForUpdates==false) {
            if (config.UpdateAvailable) {
                Console.WriteLine("An update is available, newest version is: "+config.NewestVersionNumberOnServer);
                RestartApp = ShowUpdateWindow();
            }
        }

        if (!RestartApp) {
            //Application placement - doesn't work properly with compiz (is it the window placement plugin?)
            if (config.SettingsLoadOk) {
                mainWindow.Resize(config.Window.Width, config.Window.Height);
                mainWindow.Move(config.Window.X, config.Window.Y);
                //Console.WriteLine(config.Window.X+" "+ config.Window.Y);
            }

            //ArtManager erzeugen
            man = new CArtManager(config);

            //Stores anlegen und IconViews anlegen
            for(int i=0;i<ListStoreCount;i++){
                sWins[i] = (Gtk.ScrolledWindow)(gxml.GetWidget("swin"+i));
                stores[i]= new ListStore (typeof(Pixbuf),typeof (string), typeof (string), typeof(int));
                IconViews[i] = new Gtk.IconView(stores[i]);
                IconViews[i].SelectionChanged += new System.EventHandler(OnSelChanged);
                IconViews[i].ItemActivated += new ItemActivatedHandler(OnItemActivated);
                IconViews[i].PixbufColumn = 0;
                CurrentIconView = IconViews[0];

                sWins[i].Add(IconViews[i]);
                IconViews[i].Show();
            }

            //Create the comboboxes
            imageTypeBox = ComboBox.NewText();
            imageResolutionsBox = ComboBox.NewText();
            imageStyleBox = ComboBox.NewText();

            //Verschiedene Styles hinzufügen
            imageStyleBox.AppendText(Catalog.GetString("Centered"));
            imageStyleBox.AppendText(Catalog.GetString("Filled"));
            imageStyleBox.AppendText(Catalog.GetString("Scaled"));
            imageStyleBox.AppendText(Catalog.GetString("Zoomed"));
            imageStyleBox.AppendText(Catalog.GetString("Tiled"));
            imageStyleBox.Active=0;
            imageStyleBox.Changed += new EventHandler(OnImageStyleBoxChanged);

            LowerTable.Attach(imageTypeBox,1,2,2,3);
            LowerTable.Attach(imageResolutionsBox,1,2,3,4);
            LowerTable.Attach(imageStyleBox,1,2,4,5);

            OnSwitchPage(MainNotebook,new SwitchPageArgs());
            Gtk.Application.Run ();

        }
    }
开发者ID:BackupTheBerlios,项目名称:gnomeartng-svn,代码行数:96,代码来源:Main.cs

示例15: Start

        public void Start()
        {
            window = new Window(WindowType.Toplevel);
            window.SetPosition(WindowPosition.Mouse);
            window.KeepAbove = true;
            window.Resize(200, 150);
            window.Title = "Dimensions";
            window.Deletable = false;

            Fixed fix = new Fixed();

            // width
            widthLabel = new Label();
            widthLabel.Text = "Width";
            fix.Put(widthLabel, 15, 25);

            widthInputEntry = new Entry();
            widthInputEntry.SetSizeRequest(100, 25);
            widthInputEntry.TextInserted += OnlyNumber;
            widthInputEntry.TextInserted += ChangeWidth;
            widthInputEntry.TextDeleted += ChangeWidth;
            fix.Put(widthInputEntry, 80, 20);

            // height
            heightLabel = new Label();
            heightLabel.Text = "Height";
            fix.Put(heightLabel, 15, 75);

            heightInputEntry = new Entry();
            heightInputEntry.SetSizeRequest(100, 25);
            heightInputEntry.TextInserted += OnlyNumber;
            heightInputEntry.TextInserted += ChangeHeight;
            heightInputEntry.TextDeleted += ChangeHeight;
            fix.Put(heightInputEntry, 80, 70);

            // Buttons
            okButton = new Button();
            okButton.Label = "OK";
            okButton.SetSizeRequest(80, 30);
            okButton.Clicked += okButton_Clicked;
            fix.Put(okButton, 10, 110);

            cancelButton = new Button();
            cancelButton.Label = "Cancel";
            cancelButton.SetSizeRequest(80, 30);
            cancelButton.Clicked += cancelButton_Clicked;
            fix.Put(cancelButton, 110, 110);

            window.Add(fix);
            window.ShowAll();

            widthInputEntry.Text = "" + width;
            heightInputEntry.Text = "" + height;
        }
开发者ID:JacquesLucke,项目名称:Collage,代码行数:54,代码来源:DimensionsDialog.cs


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