Reputation: 2627
I gather from this question and others like it, as well as a thorough web search, that libgluezilla is not available for OS X so it is not possible to use the WebBrowser control.
If that is still the case, is there any other way of displaying HTML within a mono application on a Mac?
EDIT: I have tried open-webkit-sharp but get a run time error like 'cannot find file ......\English.ini', which is odd as it exists in the place that is being searched. Following Lex Li's suggestion I tried with MonoMac, but evidently I need to do more than add in some name spaces and a couple of lines of initialisation code to get the program working as it compiles okay but does not actually open a window when run. I think that MonoMac is probably not the way I want to go anyway as it will prevent the code from being cross platform which is why I am going down the mono route.
Upvotes: 1
Views: 2087
Reputation: 2192
I have implemented in my application displaying HTML using mono. I use monobjc(http://www.monobjc.net/) and mono 2.8.10. Monobjc 4.0 has webkit dlls in it. You can use it.
There are two ways -
Documentation at the site is self explanatory.
2 Not recommended - Using textView -SubClass NSTextView and hook it up with your project. Now add the following code to the Setter of your subclass . I am pasting the code that can be used with monobjc.
NSString str = new NSString(value);
NSData data = str.DataUsingEncoding(NSStringEncoding.NSUnicodeStringEncoding);
var attributedString1 = new NSMutableAttributedString();
NSDictionary dict;
_htmlString = attributedString1.InitWithHTMLDocumentAttributes(data, out dict).CastAs();
TextStorage.SetAttributedString(_htmlString);
Upvotes: 1