Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowInfo properties should be private #343

Open
dtamade opened this issue Mar 30, 2017 · 2 comments
Open

WindowInfo properties should be private #343

dtamade opened this issue Mar 30, 2017 · 2 comments

Comments

@dtamade
Copy link

dtamade commented Mar 30, 2017

br_WindowInfo = cef.WindowInfo()
br_WindowInfo.SetAsChild(0)
br_WindowInfo.windowRect = [100, 100, 200, 200]
br_WindowInfo.windowName = 'CefAPP'
br = cef.CreateBrowserSync(br_WindowInfo, br_settings, url="https://www.url.com/"')

why?

@cztomczak
Copy link
Owner

Please ask questions on the Forum. Do not set properties on the WindowInfo object, these should be private. Use second parameter to SetAsChild() to set window rect, see: https://github.com/cztomczak/cefpython/blob/master/api/WindowInfo.md#setaschild

@cztomczak cztomczak changed the title Why doesn't windowRect work? WindowInfo properties should be private Mar 30, 2017
@cztomczak
Copy link
Owner

cztomczak commented Mar 30, 2017

It turns out matter is more complicated. On Windows when you set parent window handle to 0 then SetAsPopup() is being called which doesn't accept window rect in upstream CEF. The only solution I see in the hello_world.py example would be to use CEF views (Issue #252) which allows for more customization, however currently CEF views don't allow for synchronous browser creation which again complicates matters, because some of CEF Python code currently depends on synchronous creation. You could either use some other example that depend on third party GUI framework and have apis for setting window size. Or you could handle just the Windows case by using PyWin32 extension to resize window after it is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants