@@ -384,7 +384,7 @@ cdef extern from *:
384
384
# cannot cimport *, that would cause name conflicts with constants
385
385
# noinspection PyUnresolvedReferences
386
386
from cef_types cimport (
387
-
CefSettings, CefBrowserSettings, CefRect, CefPoint,
387
+
CefSettings, CefBrowserSettings, CefRect, CefSize, CefPoint,
388
388
CefKeyEvent, CefMouseEvent, CefScreenInfo,
389
389
PathKey, PK_DIR_EXE, PK_DIR_MODULE,
390
390
int32, uint32, int64, uint64,
@@ -433,6 +433,8 @@ from cef_path_util cimport *
433
433
from cef_drag_data cimport *
434
434
from cef_image cimport *
435
435
from main_message_loop cimport *
436
+
# noinspection PyUnresolvedReferences
437
+
from cef_views cimport *
436
438
437
439
# -----------------------------------------------------------------------------
438
440
# GLOBAL VARIABLES
@@ -775,6 +777,46 @@ def CreateBrowserSync(windowInfo=None,
775
777
assert IsThread(TID_UI), (
776
778
"cefpython.CreateBrowserSync() may only be called on the UI thread")
777
779
780
+
"""
781
+
# CEF views
782
+
# noinspection PyUnresolvedReferences
783
+
cdef CefRefPtr[CefWindow] cef_window
784
+
# noinspection PyUnresolvedReferences
785
+
cdef CefRefPtr[CefBoxLayout] cef_box_layout
786
+
cdef CefBoxLayoutSettings cef_box_layout_settings
787
+
cdef CefRefPtr[CefPanel] cef_panel
788
+
if not windowInfo and browserSettings \
789
+
and "window_title" in browserSettings:
790
+
# noinspection PyUnresolvedReferences
791
+
cef_window = CefWindow.CreateTopLevelWindow(
792
+
<CefRefPtr[CefWindowDelegate]?>NULL)
793
+
Debug("CefWindow.GetChildViewCount = "
794
+
+str(cef_window.get().GetChildViewCount()))
795
+
796
+
cef_window.get().CenterWindow(CefSize(800, 600))
797
+
cef_window.get().SetBounds(CefRect(0, 0, 800, 600))
798
+
# noinspection PyUnresolvedReferences
799
+
#cef_box_layout = cef_window.get().SetToBoxLayout(
800
+
# cef_box_layout_settings)
801
+
#cef_box_layout.get().SetFlexForView(cef_window, 1)
802
+
cef_window.get().SetToFillLayout()
803
+
# noinspection PyUnresolvedReferences
804
+
cef_panel = CefPanel.CreatePanel(<CefRefPtr[CefPanelDelegate]?>NULL)
805
+
cef_window.get().AddChildView(cef_panel)
806
+
cef_window.get().Layout()
807
+
cef_window.get().SetVisible(True)
808
+
cef_window.get().Show()
809
+
cef_window.get().RequestFocus()
810
+
windowInfo = WindowInfo()
811
+
windowInfo.SetAsChild(cef_window.get().GetWindowHandle())
812
+
Debug("CefWindow handle = "+str(cef_window.get().GetWindowHandle()))
813
+
"""
814
+
815
+
# Only title was set in hello_world.py example
816
+
if windowInfo and not windowInfo.windowType:
817
+
windowInfo.SetAsChild(0)
818
+
819
+
# No window info provided
778
820
if not windowInfo:
779
821
windowInfo = WindowInfo()
780
822
windowInfo.SetAsChild(0)
@@ -831,6 +873,9 @@ def CreateBrowserSync(windowInfo=None,
831
873
else:
832
874
Debug("CefBrowser::CreateBrowserSync() succeeded")
833
875
876
+
Debug("CefBrowser window handle = "
877
+
+str(cefBrowser.get().GetHost().get().GetWindowHandle()))
878
+
834
879
# Request context - part 2/2.
835
880
if g_applicationSettings["unique_request_context_per_browser"]:
836
881
requestContextHandler.get().SetBrowser(cefBrowser)
@@ -842,6 +887,21 @@ def CreateBrowserSync(windowInfo=None,
842
887
pyBrowser.SetUserData("__outerWindowHandle",
843
888
int(windowInfo.parentWindowHandle))
844
889
890
+
"""
891
+
if cef_window.get():
892
+
cef_window.get().ReorderChildView(cef_panel, -1)
893
+
cef_window.get().Layout()
894
+
cef_window.get().Show()
895
+
cef_window.get().RequestFocus()
896
+
"""
897
+
898
+
if windowInfo.parentWindowHandle == 0 and windowInfo.windowType == "child":
899
+
# Set window title in hello_world.py example
900
+
IF UNAME_SYSNAME == "Linux":
901
+
pass
902
+
ELIF UNAME_SYSNAME == "Darwin":
903
+
pass
904
+
845
905
return pyBrowser
846
906
847
907
def MessageLoop():
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4