[Mono-list] Simple example of Gtk-based Mono.WebBrowser on Windows/Mac

Doug Blank doug.blank at gmail.com
Wed Feb 20 17:11:03 UTC 2013


On Fri, Feb 15, 2013 at 1:48 PM, Ian Norton
<ian.norton-badrul at thales-esecurity.com> wrote:
> Have you had any luck? I'd be rather keen on this, especially if you can figure
> out how to hook javascript up.

Not yet, but I'm going to try to directly contact the original author.
I will post back here if I ever get something working.

-Doug


> Ian
>
> On Mon, Feb 11, 2013 at 01:36:15PM +0000, Doug Blank wrote:
>> I'm trying to come up with the simplest example of using the
>> Mono.WebBrowser using Gtk on Windows. The Windows.Forms version works
>> fine, but I need to integrate into an existing Gtk application.
>>
>> Here is a simple stab at it:
>>
>> public static void Main (string[] args)
>> {
>>     Gtk.Application.Init ();
>>     Gtk.Window win = new Gtk.Window ("Title");
>>     Mono.WebBrowser.IWebBrowser browser =
>>         Mono.WebBrowser.Manager.GetNewInstance(Mono.WebBrowser.Platform.Gtk);
>>     browser.Load(win.Handle, 500, 250);
>>     win.ShowAll ();
>>     GLib.Timeout.Add( 500, delegate {
>>         browser.Navigation.Go ("http://google.com/");
>>         return false;
>>     });
>>     Gtk.Application.Run ();
>> }
>>
>> which compiles, runs, and browser.Initialized is true. What triggers
>> the browser to actually render? It may be that I can't render this
>> directly into a window (I've looked at the mono-docbrowser [1] source,
>> and have a more complicated example, but it doesn't render either).
>>
>> Any suggestions appreciated,
>>
>> -Doug
>>
>> [1] https://github.com/mono/mono-tools/tree/master/docbrowser
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list


More information about the Mono-list mailing list