MCPcopy Create free account
hub / github.com/cztomczak/cefpython / main

Function main

examples/snippets/window_size.py:14–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def main():
15 cef.Initialize()
16 window_info = cef.WindowInfo()
17 parent_handle = 0
18 # This call has effect only on Mac and Linux.
19 # All rect coordinates are applied including X and Y parameters.
20 window_info.SetAsChild(parent_handle, [0, 0, 900, 640])
21 browser = cef.CreateBrowserSync(url="https://www.google.com/",
22 window_info=window_info,
23 window_title="Window size")
24 if platform.system() == "Windows":
25 window_handle = browser.GetOuterWindowHandle()
26 insert_after_handle = 0
27 # X and Y parameters are ignored by setting the SWP_NOMOVE flag
28 SWP_NOMOVE = 0x0002
29 # noinspection PyUnresolvedReferences
30 ctypes.windll.user32.SetWindowPos(window_handle, insert_after_handle,
31 0, 0, 900, 640, SWP_NOMOVE)
32 cef.MessageLoop()
33 del browser
34 cef.Shutdown()
35
36
37if __name__ == '__main__':

Callers 1

window_size.pyFile · 0.70

Calls 1

SetAsChildMethod · 0.45

Tested by

no test coverage detected