Version 0.30 released

This forum is closed. Please ask CefPython questions here.

Moderator: Czarek

Version 0.30 released

Postby Czarek » Sun Jul 15, 2012 1:22 pm

Version 0.30 released, comes with:
* Javascript bindings
* Javascript callbacks
* Python callbacks as arguments/return to javascript functions
* getting/setting window properties through Frame.GetProperty()/SetProperty().
* Fixed application error when closing main window.

An example of how to create bindings:

Code: Select all
def PyTest():
    print "PyTest() called"

bindings = cefpython.JavascriptBindings()
bindings.SetFunction("PyTest", PyTest)

// Pass bindings to CreateBrowser()
cefpython.CreateBrowser(... javascriptBindings=bindings ...)

Now from javascript call:

Code: Select all
window.PyTest() // "window." is optional, "PyTest()" also works.

There is also SetProperty() method so you can bind data to window object:

Code: Select all
bindings.SetProperty("config", {"option1": True, "option2": [1,2,3]})

"cefadvanced.py" comes with many tests for javascript bindings/callbacks, run it to see.

An application error was fixed when closing application (Issue 2). It was caused by a call to win32gui.DestroyWindow() in CloseApplication(), you should use win32api.PostMessage() instead:

Code: Select all
win32api.PostMessage(windowID, win32con.WM_DESTROY, 0, 0)

Download CEF Python from:
http://code.google.com/p/cefpython/
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Return to CefPython Forum

Who is online

Users browsing this forum: No registered users and 0 guests