views:

3092

answers:

2

Does anyone know of a simple "Hello World" example for using the Webkit library in Python? I have a GTK window, and inside I want to put Webkit.

With Python/mozembed (Mozilla/Gecko), this is simple:

mozembed = gtkmozembed.MozEmbed()
mozembed.load_url('http://google.com/')

..and I have already created my browser, how do I do this with WebKit?

+2  A: 

Miuler: No les gusta que usted escribio la pregunta en espanol. Si se responde en ingles puedo ayudar traducir a espanlol otra vez. I said if the answers are in English I will make sure he understands by translating back to Spanish, which he is obviously more comfortable with...

I don't think we should be language elitist, here is a rough translation. I have no idea what webkit is though. I can not edit posts, can some one edit the post above and add this? Begin transmission:

Anyone have a simple example for webkit?

Anyone know some simple example for hello world using the webkit library? I am making a gtk window and inside I want to put webkit. I have an example like python and mozembed (mozilla / gecko) which is very simple:

mozembed = gtkmozembed.MozEmbed()
mozembed.load_url('http://google.com/')

and I have already created my browser, how do I do this with WebKit? Hay ejemplos sobre el uso de lo entre el directorio: python demos / tabbed_browser.py

--------UPDATE------- karlcow dice: Has visto los Python bindings for the WebKit GTK+ port? Ver este tambien, FOSDEM by Alp Toker on WebKit GTK+ (pdf) Developing hybrid Web/GTK+ rich internet applications.

Alex
webkit is the engine of safari and google chrome.
Vasil
@Vasil: Yes it is. However that is not the only place that it is in use and where it can be used. For example, it is also a part of Qt, there is also a GTK port.
X-Istence
@X-instence: Look at the tags on SO, do you think many people know what QT is. I tried to give an answer which will ring a bell instantly.
Vasil
+5  A: 

Did you check the Python bindings for the WebKit GTK+ port. In one of the directory there are demos on how to use it, including a browser: python demos/tabbed_browser.py

You could check also the slides of a FOSDEM by Alp Toker on WebKit GTK+ (pdf) Developing hybrid Web/GTK+ rich internet applications.

import gtk 
import webkit 

view = webkit.WebView() 

sw = gtk.ScrolledWindow() 
sw.add(view) 

win = gtk.Window(gtk.WINDOW_TOPLEVEL) 
win.add(sw) 
win.show_all() 

view.open("http://w3.org/") 
gtk.main()

That should give you good hints for starting.

karlcow