Skip to content

Commit 5fa0b1d

Browse files
committed
Email image added.
1 parent 85d2104 commit 5fa0b1d

13 files changed

Lines changed: 77 additions & 803 deletions

browser.pyx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,24 @@ class PyBrowser:
105105
self.topWindowID = 0
106106
self.innerWindowID = 0
107107
(<CefBrowser*>(cefBrowser.get())).ParentWindowWillClose()
108-
(<CefBrowser*>(cefBrowser.get())).CloseBrowser()
108+
109+
# This is probably not needed, turning it off, maybe it will fix memory read errors when closing app?
110+
#(<CefBrowser*>(cefBrowser.get())).CloseBrowser()
109111

110112
def CloseDevTools(self):
111113

112114
cdef CefRefPtr[CefBrowser] cefBrowser = GetCefBrowserByInnerWindowID(CheckInnerWindowID(self.innerWindowID))
113115
(<CefBrowser*>(cefBrowser.get())).CloseDevTools()
114116

115-
def Find(self, identifier, searchText, forward, matchCase, findNext):
117+
def Find(self, searchID, searchText, forward, matchCase, findNext):
116118

117119
cdef CefRefPtr[CefBrowser] cefBrowser = GetCefBrowserByInnerWindowID(CheckInnerWindowID(self.innerWindowID))
118120

119121
cdef CefString cefSearchText
120122
cefSearchText.FromASCII(<char*>searchText)
121123

122124
(<CefBrowser*>(cefBrowser.get())).Find(
123-
<int>identifier, cefSearchText, <cbool>bool(forward), <cbool>bool(matchCase), <cbool>bool(findNext))
125+
<int>searchID, cefSearchText, <cbool>bool(forward), <cbool>bool(matchCase), <cbool>bool(findNext))
124126

125127
def GetFocusedFrame(self):
126128

cefexample/README.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ icon.ico
4343

4444
CHANGELOG.
4545

46-
Version xx released on xx.
47-
* More api for the Browser object, developer tools and others.
48-
46+
Version 0.25 released on 2012-07-07.
47+
* Browser object is almost ready, Frame still needs some work.
48+
* Client handlers are starting to work, implemented LoadHandler.
49+
4950
Version 0.22 released on 2012-07-02.
5051
* Object oriented model for the Browser api
5152
* Removed cefwindow as a dependency of cefpython module.
@@ -55,4 +56,4 @@ Version 0.21 released on 2012-07-02.
5556
* Fixed bug: browser's client area wasn't resized when window size changed.
5657

5758
Version 0.20 released on 2012-07-01.
58-
* First release that comes with real API.
59+
* First release that comes with real API.

cefexample/cefadvanced.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<br>
2222

23-
Features coming next week:
23+
Features coming next:
2424
<ul>
2525
<li>javascript execution</li>
2626
<li>javascript bindings
@@ -29,8 +29,8 @@
2929
<li>loading content from zip (optionally encrypted)
3030
</ul>
3131

32-
<iframe src="cefsimple2.html"></iframe>
33-
<img src="http://google.pl/asd.jpg">
32+
<iframe src="cefsimple.html"></iframe>
33+
<iframe src="cefsimple_onloaderror.html"></iframe>
3434

3535
<script>
3636
//frames["simple"].focus()

cefexample/cefadvanced.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def CloseApplication(windowID, msg, wparam, lparam):
1818
browser = cefpython.GetBrowserByWindowID(windowID)
1919
browser.CloseBrowser()
2020
cefwindow.DestroyWindow(windowID)
21+
return 0 # If an application processes this message, it should return zero.
2122

2223
def QuitApplication(windowID, msg, wparam, lparam):
2324

@@ -68,10 +69,10 @@ def CefAdvanced():
6869
def DocumentReady(browser, frame):
6970

7071
print "OnLoadStart(): frame URL: %s" % frame.GetURL()
71-
if frame.IsMain():
72-
return
7372
browser.GetMainFrame().ExecuteJavascript("window.open('about:blank', '', 'width=500,height=500')")
74-
#print "HidePopup(): %s" % browser.HidePopup()
73+
if frame.IsMain():
74+
return
75+
print "HidePopup(): %s" % browser.HidePopup()
7576

7677
def OnLoadError(browser, frame, errorCode, failedURL, errorText):
7778

@@ -96,16 +97,17 @@ def ModalWindow():
9697

9798

9899
def ResizeWindow():
99-
# main window, popup and modal
100+
cefwindow.MoveWindow(windowID, width=500, height=500)
100101
pass
101102

102103

103104
def MoveWindow():
104-
# main window, popup and modal
105+
cefwindow.MoveWindow(windowID, xpos=0, ypos=0)
105106
pass
106107

107108

108109
def DeveloperTools():
110+
browser.ShowDevTools()
109111
pass
110112

111113

cefexample/cefsimple.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@
55
import cefwindow
66
import win32con
77
import win32gui
8+
import sys
89

9-
def QuitApplication(windowID, msg, wparam, lparam):
10+
def CloseApplication(windowID, msg, wparam, lparam):
1011

1112
browser = cefpython.GetBrowserByWindowID(windowID)
1213
browser.CloseBrowser()
1314
cefwindow.DestroyWindow(windowID)
15+
16+
def QuitApplication(windowID, msg, wparam, lparam):
17+
1418
win32gui.PostQuitMessage(0)
19+
return 0
1520

1621
def CefSimple():
1722

18-
sys.excepthook = cefpython.ExceptHook # In case of exception display it, write to error.log, shutdown CEF and exit application.
23+
sys.excepthook = cefpython.ExceptHook
1924
cefpython.Initialize({"multi_threaded_message_loop": False})
2025
wndproc = {
21-
win32con.WM_CLOSE: QuitApplication,
26+
win32con.WM_CLOSE: CloseApplication,
27+
win32con.WM_DESTROY: QuitApplication,
2228
win32con.WM_SIZE: cefpython.wm_Size,
2329
win32con.WM_SETFOCUS: cefpython.wm_SetFocus,
2430
win32con.WM_ERASEBKGND: cefpython.wm_EraseBkgnd

cefexample/cefwindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def DestroyWindow(windowID):
9393
classname = GetWindowClassname(windowID)
9494
win32gui.UnregisterClass(classname, None)
9595
del __windows[windowID] # Let window with this classname be created again.
96-
96+
9797

9898
def GetWindowClassname(windowID):
9999

0 commit comments

Comments
 (0)