[Gtk-sharp-list] Help on getting Webkit Widget in Monodevelop?

Jacek Rużyczka stacheldraht at interia.pl
Mon Jul 25 15:04:08 EDT 2011


Am Montag 25 Juli 2011, 00:17:39 schrieb rygoody:
> I am trying to do the very basic thing of just making a web browser. I want
> to use WebKit Sharp, but am having a hell of a time figuring out exactly
> how.
> 
> I found my way to here:
> https://github.com/mono/webkit-sharp
> 
> I downloaded all the stuff on there, and am now looking at it wondering,
> what do I do with it?! Do I compile this somehow? Do I compile it with mono
> in some way? I've not ever had to do something like this with c# in VS. I
> am admiteddly fairly new to mono and monodevelop...
> 
> Could anyone help me here and explain what to do in more detail?
> 
Well, the problem is that there are no MonoDevelop bindings for the webkit-
sharp widgets. This means you have to implant a webkit-sharp based web browser 
by hand, like this:

		/* instance variable */
		private WebView             overviewBrowser;

		/* In your GUI designer, define an HBox or VBox named 
overviewBrowserBox. */

		private void Init () {
				overviewBrowser = new WebView();
				overviewBrowser.Editable = false;
				overviewBrowser.HoveringOverLink +=	
this.OnHoveringOverLinkInBrowser;
				overviewBrowser.LoadHtmlString(this.ReadOverviewPage(), null);
				overviewBrowserBox.Add(overviewBrowser);
				Gtk.Box.BoxChild w = ((Gtk.Box.BoxChild) 
overviewBrowserBox[overviewBrowser]);
				w.Position = 0;
				w.Expand = true;
				w.Fill = true;
				overviewBrowserBox.ShowAll();
				overviewBrowser.NavigationRequested += 
this.OnLinkActivatedInBrowser;
	}

		protected virtual void OnLinkActivatedInBrowser (object sender, 
NavigationRequestedArgs args)
		{
			string uri = args.Request.Uri;
			/* Do something with your click event. */
		}

		protected virtual void OnHoveringOverLinkInBrowser (object sender, 
HoveringOverLinkArgs args)
		{
			/* Do something with your hover event. */
		}

I hope this will help you.

Kind regards
Jacek

----------------------------------------------------------------
Najwieksza baza samochodow nowych i uzywanych
Sprawdz >> http://linkint.pl/f29e3


More information about the Gtk-sharp-list mailing list