You are not logged in.
Pages: 1
How would I go about embedding a web browser into my applications? Would I use something like gtkmozembed or some other thing? I want it to be able to handle flash as well. Is using webkit or gecko getting to low to the ground? Or is it easy to use these libraries to make a small browser? I just want something similar to the browser control in .NET/VC++
Offline
How would I go about embedding a web browser into my applications? Would I use something like gtkmozembed or some other thing? I want it to be able to handle flash as well. Is using webkit or gecko getting to low to the ground? Or is it easy to use these libraries to make a small browser? I just want something similar to the browser control in .NET/VC++
webkit is dead easy to embed (look at uzbl...) not sure if there's a QT wrapper for webkit too but with gtk it's really simple..
MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Offline
Thanks, do you have an example maybe? I can't seem to find any on the net. If you don't I understand though.
Offline
This is probably (definitely) a bit overkill for an example, but have a look at the Uzbl source: http://github.com/Dieterbe/uzbl/tree/master
Offline
I was playing around with this yesterday and happened to pastebin it for a mate, again it uses gtk but should show you how simple it is to get Webkit up and running. You more or less just create the WebkitWebView control, hook up some callbacks (if you want), add it to a GTK container, and load a url. Waaay simple
Offline
Hmm, so to install the libraries I need, I use this port? http://live.gnome.org/WebKitGtk
Offline
Even easier than that, just run "pacman -S libwebkit"
To compile you use something like:
gcc -o main -Wall -W `pkg-config --cflags --libs gtk+-2.0 webkit-1.0` main.c
Offline
Oh the agony, does anyone know how to include all the necessary directories in eclipse? I can't use pkg-config on it... or could I?
Last edited by caelestis (2009-05-18 00:58:35)
Offline
Well this is the output from pkg-config:
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/webkit-1.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -lwebkit-1.0 -lgtk-x11-2.0 -lsoup-2.4 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
You might be able to add all of those by hand, I don't have much experience with Eclipse so I can't help you there, maybe someone else will have a better idea
Offline
Alright, I'll just use code::blocks.
How would you access a text/input box displayed in the browser to get/insert text?
Offline
Unfortunately I'm not too sure if the webkit api allows for that kind of stuff, although it must in some way, I know you can tell webkit to execute some javascript code, but you can't retrieve the result. I think you have to use JavascriptCore for that, and I'm not sure how that works, sorry!
Offline
There is a hackish way to send info from the browser back to the app:
Call javascript in the page with exectute_script and then make that script set the title of the page (with document.title or w/e) and then add an event handler for the on title change event.
Does it have to be C++? There is a nice python tutorial here
http://www.aclevername.com/articles/python-webgui/
blog - github - facebook - google profile
Offline
Oh I see it does have to be C++, but anyway, you can use the above tutorial as a reference - since it uses PyWebkitGTK the method calls'll be similar if not the same.
blog - github - facebook - google profile
Offline
There is a hackish way to send info from the browser back to the app:
Call javascript in the page with exectute_script and then make that script set the title of the page (with document.title or w/e) and then add an event handler for the on title change event.
heh, that is indeed quite hackish
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
It's also the way I was using in my pastebinned code, but I cringe everytime I fire it up. Still it does work so I guess I should be greatful
Offline
Pages: 1