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


C# Window.ModifyBg方法代码示例

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


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

示例1: 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

示例2: Start

        public void Start()
        {
            window = new Window(WindowType.Toplevel);
            window.Move(10, 60);
            window.Resize(230, 700);
            window.Title = "Toolbar";
            window.Deletable = false;
            window.ModifyBg(StateType.Normal, new Gdk.Color(182, 195, 205));

            Fixed fix = new Fixed();

            openButton = new Button();
            openButton.Label = "Open Images";
            openButton.SetSizeRequest(100, 30);
            openButton.TooltipText = "Shortcut: " + keymap["open images"].ToString();
            openButton.Name = "open images";
            openButton.Clicked += OperatorButtonClicked;

            saveButton = new Button();
            saveButton.Label = "Save Collage";
            saveButton.SetSizeRequest(100, 30);
            saveButton.TooltipText = "Shortcut: " + keymap["save collage"].ToString();
            saveButton.Name = "save collage";
            saveButton.Clicked += OperatorButtonClicked;

            deleteButton = new Button();
            deleteButton.Label = "Delete";
            deleteButton.SetSizeRequest(100, 30);
            deleteButton.TooltipText = "Shortcut: " + keymap["delete images"].ToString();
            deleteButton.Name = "delete images";
            deleteButton.Clicked += OperatorButtonClicked;

            changeAspectRatioButton = new Button();
            changeAspectRatioButton.Label = "Aspect Ratio";
            changeAspectRatioButton.SetSizeRequest(100, 30);
            changeAspectRatioButton.TooltipText = "Shortcut: " + keymap["change aspect ratio"].ToString();
            changeAspectRatioButton.Name = "change aspect ratio";
            changeAspectRatioButton.Clicked += OperatorButtonClicked;

            autoPositionButton = new Button();
            autoPositionButton.Label = "Auto Position";
            autoPositionButton.SetSizeRequest(100, 30);
            autoPositionButton.TooltipText = "Shortcut: " + keymap["auto position"].ToString();
            autoPositionButton.Name = "auto position";
            autoPositionButton.Clicked += OperatorButtonClicked;

            changeBackgroundColorButton = new Button();
            changeBackgroundColorButton.Label = "Background";
            changeBackgroundColorButton.SetSizeRequest(100, 30);
            changeBackgroundColorButton.TooltipText = "Shortcut: " + keymap["change background color"].ToString();
            changeBackgroundColorButton.Name = "change background color";
            changeBackgroundColorButton.Clicked += OperatorButtonClicked;

            setBackwardButton = new Button();
            setBackwardButton.Label = "Set Backward";
            setBackwardButton.SetSizeRequest(100, 30);
            setBackwardButton.TooltipText = "Shortcut: " + keymap["set backward"].ToString();
            setBackwardButton.Name = "set backward";
            setBackwardButton.Clicked += OperatorButtonClicked;

            setForwardButton = new Button();
            setForwardButton.Label = "Set Forward";
            setForwardButton.SetSizeRequest(100, 30);
            setForwardButton.TooltipText = "Shortcut: " + keymap["set forward"].ToString();
            setForwardButton.Name = "set forward";
            setForwardButton.Clicked += OperatorButtonClicked;

            setAsBackgroundButton = new Button();
            setAsBackgroundButton.Label = "Set Background";
            setAsBackgroundButton.SetSizeRequest(100, 30);
            setAsBackgroundButton.TooltipText = "Shortcut: " + keymap["set as background"].ToString();
            setAsBackgroundButton.Name = "set as background";
            setAsBackgroundButton.Clicked += OperatorButtonClicked;

            setToFrontButton = new Button();
            setToFrontButton.Label = "Set to Front";
            setToFrontButton.SetSizeRequest(100, 30);
            setToFrontButton.TooltipText = "Shortcut: " + keymap["set to front"].ToString();
            setToFrontButton.Name = "set to front";
            setToFrontButton.Clicked += OperatorButtonClicked;

            clearButton = new Button();
            clearButton.Label = "Clear Collage";
            clearButton.SetSizeRequest(100, 30);
            clearButton.TooltipText = "Shortcut: " + keymap["clear collage"].ToString();
            clearButton.Name = "clear collage";
            clearButton.Clicked += OperatorButtonClicked;

            selectAllButton = new Button();
            selectAllButton.Label = "Select All";
            selectAllButton.SetSizeRequest(100, 30);
            selectAllButton.TooltipText = "Shortcut: " + keymap["select all"].ToString();
            selectAllButton.Name = "select all";
            selectAllButton.Clicked += OperatorButtonClicked;

            undoButton = new Button();
            undoButton.Label = "Undo";
            undoButton.SetSizeRequest(100, 30);
            undoButton.TooltipText = "Shortcut: " + keymap["undo"].ToString();
            undoButton.Name = "undo";
//.........这里部分代码省略.........
开发者ID:JacquesLucke,项目名称:Collage,代码行数:101,代码来源:ToolbarWindow.cs

示例3: Init

        private static void Init()
        {
            _random = new Random();

            InitializeLua();

            Application.Init();
            if (!GLib.Thread.Supported)
                GLib.Thread.Init();
            Gdk.Threads.Init();

            Gdk.Threads.Enter();

            _window = new Gtk.Window(Globals.WINDOW_NAME);
            _window.SetDefaultSize(Globals.WIDTH, Globals.HEIGHT);
            _window.AppPaintable = true;
            _window.DoubleBuffered = false;
            _window.DeleteEvent += OnWinDelete;
            _window.KeyPressEvent += OnKeyPress;
            _window.KeyReleaseEvent += OnKeyRelease;
            //_window.ConfigureEvent += OnWindowConfigure;

            DrawingArea da = new DrawingArea();
            da.ExposeEvent += OnExposed;

            Gdk.Color col = new Gdk.Color(0, 0, 0);
            _window.ModifyBg(StateType.Normal, col);
            da.ModifyBg(StateType.Normal, col);

            GLib.Timeout.Add(33, new GLib.TimeoutHandler(Graphics.TimedDraw));

            _window.Add(da);
            _window.ShowAll();

            Gdk.Threads.Leave();

            Graphics.Init();    // depends on _window being initialized
            Item.Init();
            Enemy.Init();       // depends on Globals ctor
            Weapon.Init();      // depends on Globals ctor
            Armor.Init();       // depends on Globals ctor
            Accessory.Init();   // depends on Globals ctor
            Materia.Init();     // depends on Globals ctor
            Character.Init();   // depends on [Weapons|Armor|Materia].Init()
            Globals.Init();     // depends on Character.Init()
            MenuScreen.Init();  // depends on Globals.Init()
            Inventory.Init();   // depends on a whole lot of things
            Spell.Init();       // depends on Globals ctor
            Materiatory.Init(); // depends on Materia.Init()

            int time = Int32.Parse(Globals.SaveGame.SelectSingleNode("//time").InnerText);
            _clock = new Clock(time); // depends on Globals ctor

            // Go to Main Menu
            _state = MainMenu;

            // Go to new Battle
            //GoToBattleState();

            // Go to Post-Battle
            //List<IItem> i = new List<IItem>();
            //i.Add(Item.ItemTable["powersource"]);
            //i.Add(Item.ItemTable["powersource"]);
            //i.Add(Item.ItemTable["potion"]);
            //PostBattle = new PostBattleState(234, 12, 1200, i);
            //_state = PostBattle;

            _state.Init();

            if (Globals.Party[0] == null && Globals.Party[1] == null && Globals.Party[2] == null)
                throw new GamedataException("No character in party!");

            // Level-up demo
            //using (StreamWriter w = new StreamWriter(@"c:\scripts\test.txt"))
            //{
            //    while (Character.Cloud.Level < 98)
            //    {
            //        Character.Cloud.GainExperience(Character.Cloud.ToNextLevel + 10);
            //        w.WriteLine(Character.Cloud.ToString());
            //    }
            //    w.Flush();
            //}
        }
开发者ID:skinitimski,项目名称:Reverence,代码行数:83,代码来源:Game.cs


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