By popular demand, here is the sample that I used at the ENEI presentation - a browser in 12 lines of code.
Friday, November 07, 2008
Subscribe to:
Post Comments (Atom)
Welcome to the World of Coding. Please check your keyboards at the entrance. This is a weapons-check area; all brains should be ready to fire.
By popular demand, here is the sample that I used at the ENEI presentation - a browser in 12 lines of code.
2 comments:
Nice! Would it be much harder if using System.Windows.Forms?
It would be different, as winforms doesn't have a gtk main loop which the webkit widget can use. There is an experimental webkit backend for the webbrowser control on winforms which takes care of this little problem, it's on http://anonsvn.mono-project.com/source/trunk/mono-webbrowser
You can see how it's doing it by looking at mono-webkit/EmbedWidget.cs and mono-webkit/WebBrowser.cs (the Load and InitializeWindow are the methods that make it go).
The EmbedWidget class basically wraps a winforms control inside a gtk window, and WebBrowser runs the gtk main loop on a separate thread and creates the EmbedWidget, adding a WebView to it. This allows both winforms and gtk loops to run side by side without interfering with each other.
Post a Comment