Set window size without any third party GUI framework.

631 views
Skip to first unread message

Antonio Neto

unread,
Sep 19, 2017, 7:00:34 PM9/19/17
to CEF Python
Hi,

Is there a way to set the window size and set this to fixed without attach CreateBrowserSync on a HWN?

With Tkinter I can control these settings but with a lot a code to manage window movements etc...

[]'s

Antonio

Czarek Tomczak

unread,
Sep 22, 2017, 8:08:23 AM9/22/17
to CEF Python
Hi Antonio,

You can set window size with a call to WindowInfo.SetAsChild and provide rect as a second parameter, but this parameter is applied only on Linux/Mac.

There are plans to support CEF Views which is a built-in framework for window management in CEF and allows for a lot more window configuration without depending on third party libraries. This is yet to be implemented via Issue #252.

Czarek Tomczak

unread,
Sep 22, 2017, 8:11:00 AM9/22/17
to CEF Python
You could use pywin32 extension to resize window, see for example:
https://stackoverflow.com/questions/2335721/how-can-i-get-the-window-focused-on-windows-and-re-size-it

Note that after window is resized some CEF functions need to be called to notify CEF about that resize event. See other examples for example usage (WindowUtils.OnSize and browser.NotifyMoveOrResizeStarted as I recall).

Antonio Neto

unread,
Sep 22, 2017, 4:14:59 PM9/22/17
to CEF Python
Thx for the answer!

I think pywin32 is the simplest way to use in my case.

Also is good to know about CEF Views. I'll check if I can contribute in some way.

[]'s

Antonio
Reply all
Reply to author
Forward
0 new messages