Skip to content

Commit e121f7d

Browse files
committed
Added transparent popup example to cefadvanced.py
1 parent c756c6d commit e121f7d

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

cefpython/cef1/windows/binaries/cefadvanced.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ <h3>Keyboard and mouse shortcuts</h3>
4545

4646
<h3>Browse google</h3>
4747

48-
<a href="http://www.google.com/">http://www.google.com/</a>
48+
<a href="http://www.google.com/">http://www.google.com/</a>
49+
50+
<h3>Transparent window</h3>
51+
52+
<a href="javascript:python.TransparentPopup()">
53+
python.TransparentPopup()</a>
4954

5055
<h3>Browser object</h3>
5156

@@ -290,4 +295,4 @@ <h3>Find text on this page</h3>
290295
<input type=text id=searchText value="python"> <input type=button value="python.Find()" onclick="python.Find(document.getElementById('searchText').value)">
291296

292297
</body>
293-
</html>
298+
</html>

cefpython/cef1/windows/binaries/cefadvanced.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,5 +464,12 @@ def GetUnicodeString(self):
464464
else:
465465
return "Unicode string can be tested only in python 2.x"
466466

467+
def TransparentPopup(self):
468+
windowInfo = cefpython.WindowInfo()
469+
windowInfo.SetAsPopup(self.browser.GetWindowHandle(), "transparent")
470+
windowInfo.SetTransparentPainting(True)
471+
cefpython.CreateBrowserSync(windowInfo, browserSettings={},
472+
navigateUrl=GetApplicationPath("cefsimple.html"))
473+
467474
if __name__ == "__main__":
468475
CefAdvanced()

0 commit comments

Comments
 (0)