[Mono-dev] Embedded mono using monomac classes

Mackey Kinard Mackey at ehsiplus.com
Fri May 2 09:02:27 UTC 2014


I found out that the NSView.cs class does not define a constructor... 
So how does NSView work when using without embedding?

// // Support code for NSView 
// using System; namespace MonoMac.AppKit { 
 public partial class NSView { 
      object __mt_tracking_var; 
    } 
 }

Says it's a partial class... Where is the rest of the class... I am assuming that is where
The constructor bindings are? 


Sent from my iPad

> On May 1, 2014, at 4:12 PM, Mackey Kinard <MackeyK24 at Yahoo.com> wrote:
> 
> I am trying to make a monomac library project for use in an embedded mono application.
> 
> I use a normal monomac library project which has a reference to monomac assembly.
> 
> Since I'm using from an c++ application the NSApplicationMain has already been called
> For the app by the time the library is used. So I just have an init function, in that init function
> I just do a NSApplication.Init so the thread context is setup for c# API for monomac...
> Things like NSView and NSColor...
> 
> Things work great if I pass an intptr from c++ to construct a class... I.e
> 
> NSColor blk = new NSColor(ptr-from-c++);
> blk.ToString() work as expected...
> 
> But 
> 
> NSColor blk = NSColor.Black;
> Errors with: No constructor found for MonoMac.AppKit.NSView::.ctor(System.IntPtr)
> 
> 
> It's like that with any class that I don't actually construct with the native intptr...
> 
> Again this is an embedded application.
> 
> My question is ... Is there some kind of "init bindings" that I need to implement since
> I am using from embedded app instead of regular monomac app.
> 
> Or is there a main .net bindings mechanism that I need to kick off, that the normal non
> Embedded useage of monomac does.
> 
> Do I have to got and  manually re-make all the objective -c bindings for the monomac API
> Because I am using embedded ... That would suck.
> 
> Any help or explanations on using the c# API for monomac from and embedded application.
> 
> I would hate to have to use c++ code to create instances of object in native code just to
> Pass back a pointer to managed code that I could the do something like:
> 
> NSView vw = new NSView(native-pointer);
> vw.ToString() work fine this way
> 
> As of now that is the only way I can create a view with code...
> 
> Note: I was using NSColor before for example... All classes constructors are missing when embedding
> 
> For some reason the .net constructors for the API are not available at runtime (compiles just fine) when embedding mono... Unless I am missing some kind of binding init function.
> 
> Thanks for any info.
> 
> Sent from my iPad
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20140501/86a9409a/attachment.html>


More information about the Mono-devel-list mailing list