Example #1
0
        /// <summary>
        /// The create window.
        /// </summary>
        private void CreateWindow()
        {
            var wndType = _hostConfig.HostPlacement.Frameless
                ? NativeMethods.GtkWindowType.GtkWindowPopup
                : NativeMethods.GtkWindowType.GtkWindowToplevel;

            Handle = NativeMethods.NewWindow(wndType);

            NativeMethods.SetTitle(Handle, _hostConfig.HostTitle);
            NativeMethods.SetIconFromFile(Handle, _hostConfig.HostIconFile);
            var placement = _hostConfig.HostPlacement;

            NativeMethods.SetSizeRequest(Handle, placement.Width, placement.Height);

            if (placement.CenterScreen)
            {
                NativeMethods.SetWindowPosition(Handle, NativeMethods.GtkWindowPosition.GtkWinPosCenter);
            }

            switch (_hostConfig.HostPlacement.State)
            {
            case WindowState.Normal:
                break;

            case WindowState.Maximize:
                NativeMethods.SetWindowMaximize(Handle);
                break;

            case WindowState.Fullscreen:
                NativeMethods.SetFullscreen(Handle);
                break;
            }

            NativeMethods.AddConfigureEvent(Handle);

            Realized += OnRealized;

            // A callback was made on a garbage collected delegate of type 'Chromely.CefGlue.Gtk!Chromely.CefGlue.Gtk.BrowserWindow.NativeMethods+EventHandler::Invoke'.
            // TODO: Find the reason - AND remove handlers at correct time
            if (ChromelyRuntime.Platform != ChromelyPlatform.Linux)
            {
                Resized += OnResize;
            }

            Exited += OnExit;

            NativeMethods.ShowAll(Handle);
        }
        /// <summary>
        /// The create window.
        /// </summary>
        private void CreateWindow()
        {
            mMainWindow = NativeMethods.NewWindow(NativeMethods.GtkWindowType.GtkWindowToplevel);
            NativeMethods.SetTitle(mMainWindow, mTitle);

            NativeMethods.SetIconFromFile(mMainWindow, mIconFile);

            NativeMethods.SetSizeRequest(mMainWindow, mWidth, mHeight);
            NativeMethods.SetWindowPosition(mMainWindow, NativeMethods.GtkWindowPosition.GtkWinPosCenter);

            NativeMethods.AddConfigureEvent(mMainWindow);

            Realized += OnRealized;
            Resized  += OnResize;
            Exited   += OnExit;

            NativeMethods.ShowAll(mMainWindow);
        }
Example #3
0
        /// <summary>
        /// The create window.
        /// </summary>
        private void CreateWindow()
        {
            var wndType = mHostConfig.HostFrameless
                ? NativeMethods.GtkWindowType.GtkWindowPopup
                : NativeMethods.GtkWindowType.GtkWindowToplevel;

            mMainWindow = NativeMethods.NewWindow(wndType);
            NativeMethods.SetTitle(mMainWindow, mHostConfig.HostTitle);

            NativeMethods.SetIconFromFile(mMainWindow, mHostConfig.HostIconFile);

            NativeMethods.SetSizeRequest(mMainWindow, mHostConfig.HostWidth, mHostConfig.HostHeight);

            if (mHostConfig.HostCenterScreen)
            {
                NativeMethods.SetWindowPosition(mMainWindow, NativeMethods.GtkWindowPosition.GtkWinPosCenter);
            }

            switch (mHostConfig.HostState)
            {
            case WindowState.Normal:
                break;

            case WindowState.Maximize:
                NativeMethods.SetWindowMaximize(mMainWindow);
                break;

            case WindowState.Fullscreen:
                NativeMethods.SetFullscreen(mMainWindow);
                break;
            }

            NativeMethods.AddConfigureEvent(mMainWindow);

            Realized += OnRealized;
            Resized  += OnResize;
            Exited   += OnExit;

            NativeMethods.ShowAll(mMainWindow);
        }
Example #4
0
        /// <summary>
        /// The create window.
        /// </summary>
        private void CreateWindow()
        {
            this.mMainWindow = NativeMethods.NewWindow(NativeMethods.GtkWindowType.GtkWindowToplevel);
            NativeMethods.SetTitle(this.mMainWindow, this.mHostConfig.HostTitle);

            NativeMethods.SetIconFromFile(this.mMainWindow, this.mHostConfig.HostIconFile);

            NativeMethods.SetSizeRequest(this.mMainWindow, this.mHostConfig.HostWidth, this.mHostConfig.HostHeight);

            if (this.mHostConfig.HostCenterScreen)
            {
                NativeMethods.SetWindowPosition(this.mMainWindow, NativeMethods.GtkWindowPosition.GtkWinPosCenter);
            }

            switch (this.mHostConfig.HostState)
            {
            case WindowState.Normal:
                break;

            case WindowState.Maximize:
                NativeMethods.SetWindowMaximize(this.mMainWindow);
                break;

            case WindowState.Fullscreen:
                NativeMethods.SetFullscreen(this.mMainWindow);
                break;
            }

            NativeMethods.AddConfigureEvent(this.mMainWindow);

            this.Realized += this.OnRealized;
            this.Resized  += this.OnResize;
            this.Exited   += this.OnExit;

            NativeMethods.ShowAll(this.mMainWindow);
        }