From dave at fallingcanbedeadly.com Fri Jul 6 00:05:22 2007 From: dave at fallingcanbedeadly.com (David Mitchell) Date: Thu, 5 Jul 2007 21:05:22 -0700 Subject: [Cocoa-sharp] Patch for NSObject and NSNumber Message-ID: Could someone review/commit this patch to Subversion (I have no write SVN access). It accomplishes two things: 1. It addresses what I perceive to be something of a design flaw in Cocoa# with respect to NSObject (sorry if I'm stepping on anyone's toes, here). In a nutshell, my gripe is that for any class to be acceptable from Objective C, it must include a constructor that takes an IntPtr. I understand that IntPtrs are quite necessary to do most of the Interop with Objective C, but I don't see why I should still have to be thinking about it as I build controllers and models. My patch to Object.cs addresses this by having the default constructor not call into Objective C for an IntPtr (the first call to NativeObject's accessor will take care of this if it has not been set by the time it is called), and the method FromIntPtr() has been modified so that in addition to calling a constructor that takes and IntPtr, it can also call a default constructor and then set the NativeObject on it. If you need a code example that shows how this can be useful, I can provide it. 2. It implements a wrapper for NSNumber. I've found this to be particularly useful in dealing with KeyValue coding. Thanks! --Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/5acdede0/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: cocoa-sharp-07-05-07.patch Type: application/octet-stream Size: 2831 bytes Desc: not available Url : http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/5acdede0/attachment.obj From dave at fallingcanbedeadly.com Fri Jul 6 00:55:35 2007 From: dave at fallingcanbedeadly.com (David Mitchell) Date: Thu, 5 Jul 2007 21:55:35 -0700 Subject: [Cocoa-sharp] Patch for NSObject and NSNumber (or "Why Dave is a Moron") In-Reply-To: References: Message-ID: <492910320C7043F9A031F66BAA6056CA@MarkII> The last version was broken. This one should actually work. --Dave _____ From: cocoa-sharp-bounces at lists.ximian.com [mailto:cocoa-sharp-bounces at lists.ximian.com] On Behalf Of David Mitchell Sent: Thursday, July 05, 2007 9:05 PM To: cocoa-sharp at lists.ximian.com Subject: [Cocoa-sharp] Patch for NSObject and NSNumber Could someone review/commit this patch to Subversion (I have no write SVN access). It accomplishes two things: 1. It addresses what I perceive to be something of a design flaw in Cocoa# with respect to NSObject (sorry if I'm stepping on anyone's toes, here). In a nutshell, my gripe is that for any class to be acceptable from Objective C, it must include a constructor that takes an IntPtr. I understand that IntPtrs are quite necessary to do most of the Interop with Objective C, but I don't see why I should still have to be thinking about it as I build controllers and models. My patch to Object.cs addresses this by having the default constructor not call into Objective C for an IntPtr (the first call to NativeObject's accessor will take care of this if it has not been set by the time it is called), and the method FromIntPtr() has been modified so that in addition to calling a constructor that takes and IntPtr, it can also call a default constructor and then set the NativeObject on it. If you need a code example that shows how this can be useful, I can provide it. 2. It implements a wrapper for NSNumber. I've found this to be particularly useful in dealing with KeyValue coding. Thanks! --Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/9dd3f4a5/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: cocoa-sharp-07-05-07.patch Type: application/octet-stream Size: 3169 bytes Desc: not available Url : http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/9dd3f4a5/attachment-0001.obj From dave at fallingcanbedeadly.com Fri Jul 6 01:07:52 2007 From: dave at fallingcanbedeadly.com (David Mitchell) Date: Thu, 5 Jul 2007 22:07:52 -0700 Subject: [Cocoa-sharp] Patch for NSObject and NSNumber (or "Why Dave is *still* a Moron") In-Reply-To: <492910320C7043F9A031F66BAA6056CA@MarkII> References: <492910320C7043F9A031F66BAA6056CA@MarkII> Message-ID: <8746380264DE4C569D904A2B9CF39659@MarkII> This one works. I promise. _____ From: cocoa-sharp-bounces at lists.ximian.com [mailto:cocoa-sharp-bounces at lists.ximian.com] On Behalf Of David Mitchell Sent: Thursday, July 05, 2007 9:56 PM To: cocoa-sharp at lists.ximian.com Subject: Re: [Cocoa-sharp] Patch for NSObject and NSNumber (or "Why Dave isa Moron") The last version was broken. This one should actually work. --Dave _____ From: cocoa-sharp-bounces at lists.ximian.com [mailto:cocoa-sharp-bounces at lists.ximian.com] On Behalf Of David Mitchell Sent: Thursday, July 05, 2007 9:05 PM To: cocoa-sharp at lists.ximian.com Subject: [Cocoa-sharp] Patch for NSObject and NSNumber Could someone review/commit this patch to Subversion (I have no write SVN access). It accomplishes two things: 1. It addresses what I perceive to be something of a design flaw in Cocoa# with respect to NSObject (sorry if I'm stepping on anyone's toes, here). In a nutshell, my gripe is that for any class to be acceptable from Objective C, it must include a constructor that takes an IntPtr. I understand that IntPtrs are quite necessary to do most of the Interop with Objective C, but I don't see why I should still have to be thinking about it as I build controllers and models. My patch to Object.cs addresses this by having the default constructor not call into Objective C for an IntPtr (the first call to NativeObject's accessor will take care of this if it has not been set by the time it is called), and the method FromIntPtr() has been modified so that in addition to calling a constructor that takes and IntPtr, it can also call a default constructor and then set the NativeObject on it. If you need a code example that shows how this can be useful, I can provide it. 2. It implements a wrapper for NSNumber. I've found this to be particularly useful in dealing with KeyValue coding. Thanks! --Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/4d9ef092/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: cocoa-sharp-07-05-07.patch Type: application/octet-stream Size: 3168 bytes Desc: not available Url : http://lists.ximian.com/pipermail/cocoa-sharp/attachments/20070705/4d9ef092/attachment.obj From chuck.esterbrook at gmail.com Wed Jul 25 05:18:07 2007 From: chuck.esterbrook at gmail.com (Chuck Esterbrook) Date: Wed, 25 Jul 2007 02:18:07 -0700 Subject: [Cocoa-sharp] Howdy Message-ID: <94cdd26f0707250218q3a2f9ecfga32435ae5edd1e1a@mail.gmail.com> I took my first stab at GUI programming with Mono on Mac today using WinForms. Found a major bug involving menu items in < 60 minutes. :-( I filed a report and now I'm looking elsewhere. How's life on Cocoa#? Is it realistic to be able to develop applications with it? If so, should I just be working with what shipped in Mono 1.2.4, or is it necessary to run off Subversion? Any opinions on Cocoa# vs. GTK# vs. WinForms? Any comments and insights are appreciated. Thanks, -Chuck