[Mono-osx] Using native Cocoa WebKit for System.Windows.Forms.WebBrowser on Mac OS X

Lee V. Andrus landrus2 at by-rite.net
Wed Jul 8 18:09:28 EDT 2009

I have more free time, but not your expertise and daring with the Mono
infrastructure.  Perhaps we could come to some agreement on how to divide
the work.  We should start by adding a build option for it (perhaps
--with-cocoa).  That should make it easier to get our early work checked in
as only people that ask for it would be subjected to it.  Of course, we need
to settle on a good C#-Cocoa bridge, one that the Mono-OSX community can
accept as an dependency of Mono.  My knowledge of the several bridges
available consists of reading what others have written about them.

According to Monobjc's documentation, it supports Cocoa classes NSStatusBar
and NSStatusItem.  I've read that Cocoa-sharp has not been maintained for
some time.  NObjective claims to support bidirectional exception
translation.  It includes a translator that uses info from Objective C
Introspection to build or update a bridge for an whole framework at a time.

But the recommended method for accessing Cocoa from a Carbon program seems
to be create C function(s) in a Objective C (.M) file, and inside each
function start by creating an auto-release pool and end by draining it.  If
I were doing just the Notification Icons, I would probably do something like
that rather than introduce a bridge.  But I think the NotifyIcon would need
to retain a reference to the NSStatusItem, and I am not sure how draining
the pool will mix with that.

I am not looking to get fancy with the Notification Icons--just the basic
operations of Mono's System.Windows.Forms.NotifyIcon class: displaying the
icon, detecting a mouse click on it, handling its right-click menu, and
maybe a tooltip/balloon tip/help tag.  I believe NSStatusItem supports
these.  Bridging these classes may be all that is needed.

Alexander Shulgin wrote:
> I too feel the need for replacing Carbon-based driver with the 
> Cocoa-based one.  However, because I'm doing mono on Mac stuff for my 
> job, would I have time to contribute on this part very much depends on 
> the needs and interests of my employer.  So I can't answer this question 
> now, but may be I could go for it later. :)
> I didn't have a look on notifications, but from what I've seen the fancy 
> ones (with round shape, fade effects, etc.) are most probably can only 
> be done using Cocoa.  I've used Monobjc for the sake of example's 
> simplicity.  Maybe we can try Cocoa-sharp or some similar wrapper, e.g. 
> by extracting the only needed parts?..

View this message in context: http://www.nabble.com/Using-native-Cocoa-WebKit-for-System.Windows.Forms.WebBrowser-on-Mac-OS-X-tp24189805p24400276.html
Sent from the Mono - OSX mailing list archive at Nabble.com.

More information about the Mono-osx mailing list