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


C# Window.ModifyBg方法代码示例

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


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

示例1: FilezooPanel

    public FilezooPanel(Filezoo fz)
        : base("Filezoo Panel")
    {
        Fz = fz;
        Decorated = false;
        Resizable = false;
        SkipPagerHint = true;
        SkipTaskbarHint = true;

        FilezooWindow = new Window ("Filezoo");
        Gdk.Colormap cm = FilezooWindow.Screen.RgbaColormap;
        if (cm != null && FilezooWindow.Screen.IsComposited) {
          Widget.DefaultColormap = cm;
          FilezooWindow.Colormap = cm;
        }
        FilezooWindow.Decorated = false;
        FilezooWindow.Add (Fz);
        byte r, g, b;
        r = (byte)(Fz.Renderer.BackgroundColor.R * 255);
        g = (byte)(Fz.Renderer.BackgroundColor.G * 255);
        b = (byte)(Fz.Renderer.BackgroundColor.B * 255);
        FilezooWindow.ModifyBg (StateType.Normal, new Gdk.Color(r,g,b));

        Controls = new FilezooPanelControls(Fz, FilezooWindow);

        Add (Controls);
        Stick ();

        Fz.Width = 400;
        Fz.Height = 1000;
    }
开发者ID:kig,项目名称:filezoo,代码行数:31,代码来源:panel.cs

示例2: Main

    /**
    The Main method inits the Gtk application and creates a Filezoo instance
    to run.
      */
    static void Main(string[] args)
    {
        Window win;
        Profiler p = Helpers.StartupProfiler;
        p.Restart ();
        p.MinTime = 0;
        Profiler.GlobalPrintProfile = true;
        Helpers.ShowTextExtents = false;

        Catalog.Init("i18n","./locale");
        Application.Init ();

        p.Time ("Init done");

        bool panelMode = (Array.IndexOf (args, "--panel") > -1);
        args = Helpers.Without(args, "--panel");

        int panelBgIdx = Array.IndexOf(args, "--panel-bg");
        string panelBg = "";
        if (panelBgIdx > -1 && panelBgIdx != args.Length-1) {
          panelBg = args[panelBgIdx + 1];
          args = Helpers.Without (args, panelBg);
        }
        args = Helpers.Without (args, "--panel-bg");

        string dir = panelMode ? Helpers.HomeDir : ".";
        Filezoo fz = new Filezoo (dir);
        new FilezooConfig (args).Apply(fz);

        p.Time ("Created Filezoo");

        byte r, g, b;
        r = (byte)(fz.Renderer.BackgroundColor.R * 255);
        g = (byte)(fz.Renderer.BackgroundColor.G * 255);
        b = (byte)(fz.Renderer.BackgroundColor.B * 255);
        fz.ModifyBg (StateType.Normal, new Gdk.Color(r,g,b));

        if (panelMode) {
          win = new FilezooPanel (fz);
        //       Gnome.PanelApplet applet = new Gnome.PanelApplet ();
        //       applet.Add (win);
        //       applet.ShowAll ();
          if (panelBg.Length > 0) {
        Gdk.Color c = new Gdk.Color(0,0,0);
        if (Gdk.Color.Parse(panelBg, ref c)) {
          win.ModifyBg (StateType.Normal, c);
        } else {
          Helpers.LogError("Failed to parse panel bg color: {0}", panelBg);
        }
          }
        } else {
          win = new Window ("Filezoo");
          win.SetDefaultSize (420, 800);
          Gdk.Colormap cm = win.Screen.RgbaColormap;
          if (cm != null && win.Screen.IsComposited) {
        Widget.DefaultColormap = cm;
        win.Colormap = cm;
          }
          VBox vbox = new VBox (false, 0);
          FilezooControls controls = new FilezooControls(fz);
          vbox.PackStart (fz, true, true, 0);
          vbox.PackEnd (controls, false, false, 0);
          win.Add (vbox);
          win.ModifyBg (StateType.Normal, new Gdk.Color(r,g,b));
        }

        win.DeleteEvent += new DeleteEventHandler (OnQuit);
        win.ShowAll ();

        Application.Run ();
    }
开发者ID:kig,项目名称:filezoo,代码行数:75,代码来源:main.cs


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