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]})

"" 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:
Maintainer of the CEF Python, PHP Desktop, CEF2go and CEF C API projects.
User avatar
Posts: 952
Joined: Sun Nov 06, 2011 2:12 am
Location: Poland

Return to CefPython Forum

Who is online

Users browsing this forum: No registered users and 1 guest