Updated wx-subpackage to make it work on Linux. · stdexception/cefpython@9920379 · GitHub
Skip to content

Commit 9920379

Browse files
committed
Updated wx-subpackage to make it work on Linux.
1 parent 623e26a commit 9920379

6 files changed

Lines changed: 102 additions & 84 deletions

File tree

cefpython/cef1/wx-subpackage/chromectrl.py

Lines changed: 47 additions & 45 deletions
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset=utf-8>
5+
<title>sample 1</title>
6+
<style>
7+
body { font: 13px Segoe UI, Arial; line-height: 1.4em; }
8+
pre { background: #ddd; font: 12px Consolas, Courier New; }
9+
</style>
10+
</head>
11+
<body>
12+
13+
sample1.py - wxPython example for the CEF Python framework
14+
15+
<h3>Google Search</h3>
16+
17+
<a href="http://www.google.com/">http://www.google.com/</a>
18+
19+
<h3>User agent</h3>
20+
21+
<script>document.write(navigator.userAgent)</script>
22+
23+
<h3>Popup</h3>
24+
25+
<a href="javascript:window.open('sample1.html')">
26+
window.open('sample1.html')</a>
27+
28+
<br><br><br><br><br><br><br><br><br><br><br>
29+
<br><br><br><br><br><br><br><br><br><br><br>
30+
<br><br><br><br><br><br><br><br><br><br><br>
31+
32+
</body>
33+
</html>

cefpython/cef1/wx-subpackage/examples/sample1.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import os
55
import wx
6-
76
import cefpython1.wx.chromectrl as chrome
87

98
class MainFrame(wx.Frame):
@@ -12,10 +11,8 @@ def __init__(self):
1211
title='cefwx example1', size=(600,400))
1312

1413
self.cefWindow = chrome.ChromeWindow(self,
15-
#url=os.path.join(os.path.dirname(os.path.abspath(__file__)),
16-
# "../cefsimple.html"))
1714
url=os.path.join(os.path.dirname(os.path.abspath(__file__)),
18-
"../withpopup.html"))
15+
"sample1.html"))
1916

2017
sizer = wx.BoxSizer()
2118
sizer.Add(self.cefWindow, 1, wx.EXPAND, 0)
@@ -28,11 +25,10 @@ def OnClose(self, event):
2825

2926
if __name__ == '__main__':
3027
chrome.Initialize()
31-
print('wx.version=%s' % wx.version())
28+
print('sample1.py: wx.version=%s' % wx.version())
3229
app = wx.PySimpleApp()
3330
MainFrame().Show()
3431
app.MainLoop()
35-
del app # Let wx.App destructor do the cleanup before calling cefpython.Shutdown().
32+
# Important: do the wx cleanup before calling Shutdown.
33+
del app
3634
chrome.Shutdown()
37-
38-

cefpython/cef1/wx-subpackage/examples/sample2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import wx
55
import wx.lib.agw.flatnotebook as fnb
6-
76
import cefpython1.wx.chromectrl as chrome
87

98
ROOT_NAME = "My Locations"
@@ -21,7 +20,7 @@
2120
class MainFrame(wx.Frame):
2221
def __init__(self):
2322
wx.Frame.__init__(self, parent=None, id=wx.ID_ANY,
24-
title='cefwx example2', size=(600, 400))
23+
title='cefwx example2', size=(1024, 768))
2524

2625
self.initComponents()
2726
self.layoutComponents()
@@ -57,18 +56,19 @@ def OnSelChanged(self, event):
5756
event.Skip()
5857

5958
def OnPageClosing(self, event):
60-
print "One could place some extra closing stuff here"
59+
print("sample2.py: One could place some extra closing stuff here")
6160
event.Skip()
6261

6362
def OnClose(self, event):
6463
self.Destroy()
6564

6665
if __name__ == '__main__':
6766
chrome.Initialize()
68-
print('wx.version=%s' % wx.version())
67+
print('sample2.py: wx.version=%s' % wx.version())
6968
app = wx.PySimpleApp()
7069
MainFrame().Show()
7170
app.MainLoop()
72-
del app # Let wx.App destructor do the cleanup before calling cefpython.Shutdown().
71+
# Important: do the wx cleanup before calling Shutdown.
72+
del app
7373
chrome.Shutdown()
7474

cefpython/cef1/wx-subpackage/examples/sample3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import os
55
import wx
66
import wx.lib.agw.flatnotebook as fnb
7-
87
import cefpython1.wx.chromectrl as chrome
98

109
class MainFrame(wx.Frame):
@@ -70,10 +69,11 @@ def _LayoutComponents(self):
7069

7170
if __name__ == '__main__':
7271
chrome.Initialize()
73-
print('wx.version=%s' % wx.version())
72+
print('sample3.py: wx.version=%s' % wx.version())
7473
app = wx.PySimpleApp()
7574
MainFrame().Show()
7675
app.MainLoop()
77-
del app # Let wx.App destructor do the cleanup before calling cefpython.Shutdown().
76+
# Important: do the wx cleanup before calling Shutdown.
77+
del app
7878
chrome.Shutdown()
7979

cefpython/cef1/wx-subpackage/utils.py

Lines changed: 10 additions & 23 deletions

0 commit comments

Comments
 (0)