[Mono-bugs] [Bug 63193][Blo] Changed - NSRunAlertPanel isn't gen'ed.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 17 Aug 2004 01:59:12 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by grompf@sublimeintervention.com.

http://bugzilla.ximian.com/show_bug.cgi?id=63193

--- shadow/63193	2004-08-17 01:05:22.000000000 -0400
+++ shadow/63193.tmp.29032	2004-08-17 01:59:12.000000000 -0400
@@ -1,22 +1,21 @@
 Bug#: 63193
 Product: Cocoa#
 Version: 0.1
-OS: 
+OS: unknown
 OS Details: 10.3.5
 Status: NEW   
 Resolution: 
-Severity: 
-Priority: Wishlist
+Severity: Unknown
+Priority: Blocker
 Component: Bindings.
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: mjedgar@nycap.rr.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
-Cc: 
 Summary: NSRunAlertPanel isn't gen'ed.
 
 Please fill in this template when reporting a bug, unless you know what you are doing.
 Description of Problem:
 NSRunAlertPanel is not included by the generator. It's kinda important.
 
@@ -33,6 +32,58 @@
 
 How often does this happen? 
 
 Every time.
 
 Additional Information:
+
+------- Additional Comments From grompf@sublimeintervention.com  2004-08-17 01:59 -------
+This is actually a bug with all the APPKIT_EXTERN types
+ref: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/
+ObjC_classic/Functions/AppKitFunctions.html#//apple_ref/doc/uid/20000695/BAJCBDII
+
+We're going to need to bind these seperately into a AppKitExtern class or something like 
+that;
+
+the parsing isn't difficult (stub the methods; take in a string construct a nsstring and 
+compile return the result) the question is where should these live
+
+Apple.AppKit.AppKitExterns?
+which would mean 
+AppKitExtern.NSRunAlertPanel?
+
+urs; thoughts on the naming issue?
+
+-kang
+
+(FOR EXAMPLE:)
+using System;
+using System.Runtime.InteropServices;
+using Apple.Foundation;
+
+namespace Apple.AppKit {
+
+        public class AppKitExtern {
+
+                [DllImport("/System/Library/Frameworks/AppKit.Framework/AppKit", 
+EntryPoint="NSRunAlertPanel")]
+                protected static extern int extern_NSRunAlertPanel(IntPtr title, IntPtr msg, IntPtr 
+btn1, IntPtr btn2, IntPtr btn3);
+
+                public static int NSRunAlertPanel(string _title, string _msg, string _btn1, string 
+_btn2, string _btn3) {
+                        NSString title = new NSString(_title);
+                        NSString msg = new NSString(_msg);
+                        NSString btn1 = new NSString(_btn1);
+                        NSString btn2 = new NSString(_btn2);
+                        NSString btn3 = new NSString(_btn3);
+                        return extern_NSRunAlertPanel(title.Raw, msg.Raw, btn1.Raw, btn2.Raw, 
+btn3.Raw);
+                }
+
+        }
+}
+
+This class added to AppKit can call a NSRunAlertPanel like so:
+                        AppKitExtern.NSRunAlertPanel("Title", "Message", "B1", "B2", "B3");
+
+