Re: [us...@lists.monobjc.net] Re: [us...@lists.monobjc.net] Feeback Wanted on Snow Leopard
Hi Anthony, Building from source really is very easy. Download the sources, patch the source and configure/make/install : # wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.4.2.3.tar.bz2 # tar xvfj mono-2.4.2.3.tar.bz2 # cd mono-2.4.2.3 # ... add the if() from sledge ... # ./configure --prefix=/usr # make # make install I also surely hope the people from mono apply the patch asap into the next version of mono. Good luck, Miguel Anthony Bowker wrote: Hello all! I see that someone has added a possible workaround to the bug# 537764. I've just been testing my monobjc app on Snow Leopard and, of course, encountered the same problem. So my great appreciation to Sledge Ham. It would be awesome to get this fix into Mono 2.6, and I do think this bug is Critical. I haven't built mono before, and I'm not sure I have a system capable of doing it, but if someone has the relevant binary with the workaround, I would be happy to test it on my systems. Regards, Anthony From: laurent.etiem...@gmail.com [mailto:laurent.etiem...@gmail.com] On Behalf Of Laurent Etiemble Sent: Wednesday, September 23, 2009 7:47 AM To: users@lists.monobjc.net Subject: Re: [users@lists.monobjc.net] Re: [us...@lists.monobjc.net] Feeback Wanted on Snow Leopard Hello, - I have tried the sample app that Kenny has created and I am able to reproduce the crash every time on Snow Leopard. Obsviouly, it seems related to the Mono garbage collection, but I still don't know if Monobjc plays a role. - Has someone been able to create a sample application that crashes without Monobjc ? It surely will boost the reaction on the #537764 entry, if Monobjc is not involved and a simple use-case is provided. - I will try to take time this weekend to play with the sample application, to see if I can narrow further the crash. Regards, Laurent Etiemble. 2009/9/23 Miguel De Buf <miguel.de...@nomadesk.com> Hi Laurent, Did you find some time to look further into the mono/monobjc issue on snow leopard ? We have someone working on the problem as well (unfortunately no fix yet), so if you want to share some findings, feel free. And very strange, but nobody seems to be interested at the mono side. The bug report does not show any movement. Any idea on how we can trigger the nice mono people to look into the issue ? Best regards, Miguel Franky De Meyer wrote: @Laurent: Did you get a chance to try out the modified sample app that Kenny created? If so, what is your feeling? Does it indeed look like a Mono problem related to garbage collection? There doesn't seem to be any action in the bugzilla report https://bugzilla.novell.com/show_bug.cgi?id=537764 I have taken the liberty to change the severity to "Major" (actually it should even be "Critical", IMHO), but I get a feeling we may be weeks or months away from a reply or fix. No other developers seem to be confirming the problem, which is weird. I'm getting more and more questions from users who have upgraded to Snow Leopard and can no longer use our software. @Kenny: Did you find out anything more on this? Any clues on a work-around. Thanks all! Franky From: Kenny Clement [mailto:psyki...@gmail.com] Sent: dinsdag 15 september 2009 19:49 To: users@lists.monobjc.net Cc: psyki.be+nomad...@gmail.com Subject: Re: [users@lists.monobjc.net] Re: [us...@lists.monobjc.net] Feeback Wanted on Snow Leopard Hi, Me again. I narrowed it down a bit more. I adjusted the SimpleCocoaApp MonoObjc sample. I removed all unrequired stuff, and just kept 1 button connected to an action in HelloController. Clicking the button will open the default about panel, sleep for 1 millisec, and then force Garbage Collection. This ALWAYS causes the crash on Snow Leopard, and works without any issues on Leopard. Note that I didn't do anything with threading (excluding default Mono/MonobjC threads) in this sample. You can find the sample app + sourcecode attached to the original bug report: https://bugzilla.novell.com/show_bug.cgi?id=537764 I hope someone here can help me. Feel free to contact me if there are any questions. Thanks in advance, - Kenny Laurent Etiemble wrote: Hello, @Franz: - Can you append the stack trace and all the information to the this bug entry (https://bugzilla.novell.com/show_bug.cgi?id=537764) ? - Are you able to get a small sample application (only with the awakeFromNib call) method that exhibits the crash, so I can investigate ? Regards, Laurent Etiemble. ith any attachments. -- Miguel DE BUF CTO Tel. +32 9 233 68 86 Fax +32 9 240 10 39 miguel.de...@nomadesk.com Confidentiality Notice: This message, together with any attachments, is intended only for the use of the
Re: [us...@lists.monobjc.net] Re: [us...@lists.monobjc.net] Feeback Wanted on Snow Leopard
Hi Laurent, Did you find some time to look further into the mono/monobjc issue on snow leopard ? We have someone working on the problem as well (unfortunately no fix yet), so if you want to share some findings, feel free. And very strange, but nobody seems to be interested at the mono side. The bug report does not show any movement. Any idea on how we can trigger the nice mono people to look into the issue ? Best regards, Miguel Franky De Meyer wrote: @Laurent: Did you get a chance to try out the modified sample app that Kenny created? If so, what is your feeling? Does it indeed look like a Mono problem related to garbage collection? There doesn't seem to be any action in the bugzilla report https://bugzilla.novell.com/show_bug.cgi?id=537764 I have taken the liberty to change the severity to "Major" (actually it should even be "Critical", IMHO), but I get a feeling we may be weeks or months away from a reply or fix. No other developers seem to be confirming the problem, which is weird. I'm getting more and more questions from users who have upgraded to Snow Leopard and can no longer use our software. @Kenny: Did you find out anything more on this? Any clues on a work-around. Thanks all! Franky From: Kenny Clement [mailto:psyki...@gmail.com] Sent: dinsdag 15 september 2009 19:49 To: users@lists.monobjc.net Cc: psyki.be+nomad...@gmail.com Subject: Re: [users@lists.monobjc.net] Re: [us...@lists.monobjc.net] Feeback Wanted on Snow Leopard Hi, Me again. I narrowed it down a bit more. I adjusted the SimpleCocoaApp MonoObjc sample. I removed all unrequired stuff, and just kept 1 button connected to an action in HelloController. Clicking the button will open the default about panel, sleep for 1 millisec, and then force Garbage Collection. This ALWAYS causes the crash on Snow Leopard, and works without any issues on Leopard. Note that I didn't do anything with threading (excluding default Mono/MonobjC threads) in this sample. You can find the sample app + sourcecode attached to the original bug report: https://bugzilla.novell.com/show_bug.cgi?id=537764 I hope someone here can help me. Feel free to contact me if there are any questions. Thanks in advance, - Kenny Laurent Etiemble wrote: Hello, @Franz: - Can you append the stack trace and all the information to the this bug entry (https://bugzilla.novell.com/show_bug.cgi?id=537764) ? - Are you able to get a small sample application (only with the awakeFromNib call) method that exhibits the crash, so I can investigate ? Regards, Laurent Etiemble. ith any attachments. -- Miguel DE BUF CTO Tel. +32 9 233 68 86 Fax +32 9 240 10 39 miguel.de...@nomadesk.com Confidentiality Notice: This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments.
Re: [EMAIL PROTECTED] transfer data from one window to another ?
Hi Laurent, I get that, and it works really nice, but I cannot pass data from one controller to another :-( In Form1Controller, I execute loadnib('Form2'). And I need to pass some data to Form2Controller. Since loadnib('Form2') does not return me a pointer to the controller or so, I cannot pass data to that controller. I am almost sure, I am missing something here... Thanks, Miguel Laurent Etiemble wrote: Hello, In Cocoa, you should follow Model/View/Controller pattern. So you should consider the FormXController as the entry points for manipulating the windows. This means that you should pass data from a controller to another (Don't put your logic in NSWindow subclasses). Regards, Laurent Etiemble. 2008/11/12 Miguel De Buf <[EMAIL PROTECTED]>: Hi all, I want to transfer data from one window to another, and cannot find a decent way to do that (if possible at all). Note that I am a cocoa beginner coming from winforms. The use case is : 1. I open a form (loadnib) with controller Form1Controller. 2. From within the controller, I open a second form (loadnib) with controller Form2Controller. 3. I want to pass custom data to Form2 during this creation/form-loading. How can I accomplish that ? In winforms, I would just do (from within Form1) : ... Form2 f = new Form2(); f.customData = "mycustomdata"; ... Seems so simple... Thanks in advance, Miguel -- Miguel De Buf Chief Technology Officer Aventiv NV, creators of NomaDesk(R) Tel. +32 9 233 68 86 (Belgium) Fax +32 9 240 10 39 (Belgium) [EMAIL PROTECTED] Confidentiality Notice: This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments. -- *Miguel De Buf* Chief Technology Officer Aventiv NV, creators of NomaDesk® <http://www.NomaDesk.com/> Tel. +32 9 233 68 86 (/Belgium/) Fax +32 9 240 10 39 (/Belgium/) [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Confidentiality Notice: /This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments./
[EMAIL PROTECTED] transfer data from one window to another ?
Hi all, I want to transfer data from one window to another, and cannot find a decent way to do that (if possible at all). Note that I am a cocoa beginner coming from winforms. The use case is : 1. I open a form (loadnib) with controller Form1Controller. 2. From within the controller, I open a second form (loadnib) with controller Form2Controller. 3. I want to pass custom data to Form2 during this creation/form-loading. How can I accomplish that ? In winforms, I would just do (from within Form1) : ... Form2 f = new Form2(); f.customData = "mycustomdata"; ... Seems so simple... Thanks in advance, Miguel -- *Miguel De Buf* Chief Technology Officer Aventiv NV, creators of NomaDesk® <http://www.NomaDesk.com/> Tel. +32 9 233 68 86 (/Belgium/) Fax +32 9 240 10 39 (/Belgium/) [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Confidentiality Notice: /This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments./
Re: [EMAIL PROTECTED] How to catch window close event ?
It works if I set the delegate in interface builder for the window to MyWindow, and if I modify my code to : using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; namespace windows_events { [ObjectiveCClass] public class MyWindow : NSObject { public MyWindow() : base() { } public MyWindow(IntPtr native_object) : base(native_object) { } [ObjectiveCMessage("awakeFromNib")] public void awakeFromNib() { Console.WriteLine(this.GetType().ToString() + " : awakeFromNib"); } [ObjectiveCMessage("windowWillClose:")] public void windowWillClose(NSNotification notification) { Console.WriteLine("window closes"); } } } Cheers, Miguel Miguel De Buf wrote: Hi, I try to catch a window close event in my controller class, but the eventhandler never gets executed. This is my code : using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; namespace windows_events { [ObjectiveCClass] public class MyWindow : NSWindow { public MyWindow() : base() { } public MyWindow(IntPtr native_object) : base(native_object) { } [ObjectiveCMessage("awakeFromNib")] public void awakeFromNib() { Console.WriteLine(this.GetType().ToString() + " : awakeFromNib"); this.WindowWillClose += new WindowWillCloseEventHandler(MyWindow_WindowWillClose); } void MyWindow_WindowWillClose(NSNotification notification) { Console.WriteLine("window closes"); } } } The documentation says, just add an event handler. So I subclassed from NSWindow and just added an event handler, but it never gets executed. Why ? Many thanks, Miguel
[EMAIL PROTECTED] How to catch window close event ?
Hi, I try to catch a window close event in my controller class, but the eventhandler never gets executed. This is my code : using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; namespace windows_events { [ObjectiveCClass] public class MyWindow : NSWindow { public MyWindow() : base() { } public MyWindow(IntPtr native_object) : base(native_object) { } [ObjectiveCMessage("awakeFromNib")] public void awakeFromNib() { Console.WriteLine(this.GetType().ToString() + " : awakeFromNib"); this.WindowWillClose += new WindowWillCloseEventHandler(MyWindow_WindowWillClose); } void MyWindow_WindowWillClose(NSNotification notification) { Console.WriteLine("window closes"); } } } The documentation says, just add an event handler. So I subclassed from NSWindow and just added an event handler, but it never gets executed. Why ? Many thanks, Miguel
Re: [EMAIL PROTECTED] How to listen for notifications (NSDistributedNotificationCenter) ?
Great! it works! Thanks, Miguel Duane Wandless wrote: Hopefully this will help you. Sorry for the bad formatting... trying out Opera. [ObjectiveCMessage("init")] public override Id Init() { ObjectiveCRuntime.SendMessageSuper(this, ControllerClass, "init"); NSNotificationCenter.DefaultCenter.AddObserverSelectorNameObject(this, ObjectiveCRuntime.Selector("doAuth:"), "doAuth", null); return this; } [ObjectiveCMessage("doAuth:")] public void SelectionChanged(NSNotification notification) { NSArray loginParms = notification.UserInfo.ObjectForKey(new NSString("params")).CastTo(); Session.DoAuthenticate(loginParms[0].CastTo(), loginParms[1].CastTo()); } In the .m: NSString *username = [usernameTextField stringValue]; NSString *password = [passwordTextField stringValue]; NSArray *loginParams = [NSArray arrayWithObjects:username, password, nil]; NSDictionary* dict = [NSDictionary dictionaryWithObject:loginParams forKey:@"params"]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName:@"doAuth" object:nil userInfo:dict]; Duane On Thu, Oct 9, 2008 at 9:22 AM, Miguel De Buf <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: Hi, I am trying to use NSDistributedNotificationCenter to send a notification to a listener application. I am stuck since I do not know what to pass to the AddObserverSelectorNameObject() function. I could not find an example or more info on how to use this function. Here is my code (which fails to compile) : using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; namespace ipc_listener { class Program : NSObject { private static Listener l = null; static void Main(string[] args) { ObjectiveCRuntime.LoadFramework("Cocoa"); ObjectiveCRuntime.Initialize(); NSApplication.Initialize(); l = new Listener(); l.run(); NSApplication.RunApplication(); } } class Listener : NSObject { private NSNotificationCenter nc = null; private delegate void NotificationHandler(NSNotification n); public void run() { nc = NSDistributedNotificationCenter.DefaultCenter; NotificationHandler h = handler; nc.AddObserverSelectorNameObject((Id)this, h, (NSString)null, (Id)null); } void handler(NSNotification n) { Console.WriteLine("name=" + n.Name); } } } What fails is the nc.AddObserverSelectorNameObject() call, since the delegate h cannot be converted to an IntPtr. I have no idea what that IntPtr actially represents. I am sorry if this is a simple question, but I am very new to MacOSX programming and Cocoa, and do not know ObjC at all. Many thanks, Miguel -- *Miguel De Buf* Chief Technology Officer Aventiv NV, creators of NomaDesk® <http://www.NomaDesk.com/> Tel. +32 9 233 68 86 (/Belgium/) Fax +32 9 240 10 39 (/Belgium/) [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Confidentiality Notice: /This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments./ -- *Miguel De Buf* Chief Technology Officer Aventiv NV, creators of NomaDesk® <http://www.NomaDesk.com/> Tel. +32 9 233 68 86 (/Belgium/) Fax +32 9 240 10 39 (/Belgium/) [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Confidentiality Notice: /This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments./
[EMAIL PROTECTED] How to listen for notifications (NSDistributedNotificationCenter) ?
Hi, I am trying to use NSDistributedNotificationCenter to send a notification to a listener application. I am stuck since I do not know what to pass to the AddObserverSelectorNameObject() function. I could not find an example or more info on how to use this function. Here is my code (which fails to compile) : using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; namespace ipc_listener { class Program : NSObject { private static Listener l = null; static void Main(string[] args) { ObjectiveCRuntime.LoadFramework("Cocoa"); ObjectiveCRuntime.Initialize(); NSApplication.Initialize(); l = new Listener(); l.run(); NSApplication.RunApplication(); } } class Listener : NSObject { private NSNotificationCenter nc = null; private delegate void NotificationHandler(NSNotification n); public void run() { nc = NSDistributedNotificationCenter.DefaultCenter; NotificationHandler h = handler; nc.AddObserverSelectorNameObject((Id)this, h, (NSString)null, (Id)null); } void handler(NSNotification n) { Console.WriteLine("name=" + n.Name); } } } What fails is the nc.AddObserverSelectorNameObject() call, since the delegate h cannot be converted to an IntPtr. I have no idea what that IntPtr actially represents. I am sorry if this is a simple question, but I am very new to MacOSX programming and Cocoa, and do not know ObjC at all. Many thanks, Miguel -- *Miguel De Buf* Chief Technology Officer Aventiv NV, creators of NomaDesk® <http://www.NomaDesk.com/> Tel. +32 9 233 68 86 (/Belgium/) Fax +32 9 240 10 39 (/Belgium/) [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Confidentiality Notice: /This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this item in error, please notify the original sender and destroy this item, along with any attachments./
Re: [EMAIL PROTECTED] NSApplication.LoadNib() fails.
Hi Laurent, Thanks for your reply. It indeed works if I create a bundle. It seemed strange to me as cocoa-sharp did not require this specific directory structure. Miguel Laurent Etiemble wrote: Hello, The error you get roughly means that the NIB file has not been found. When developing a Cocoa application with Monobjc, you have to follow the specific directory structure of a Cocoa Application Bundle. I suggest you to read http://www.monobjc.net/index.php?page=anatomy-of-an-application and http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/BundleAnatomy.html to learn about the structure. In most cases, everything that apply to Cocoa can be applied to Monobjc. Regards, Laurent Etiemble 2008/9/25 Miguel De Buf <[EMAIL PROTECTED]>: Hi all, I am new to monobjc (just discovered it), and want to try it out. Nevertheless, I fail to load a nib. My code always returns '633579382263870320 [ERROR] NSApplication - Error while loading the NIB file'. I am on MacOSX 10.4.11 (Tiger) and have mono 1.9.1 installed (latest version). I downloaded monobjc-2.0.272.0 and use the assemblies from under the dist/1.0/ folder. I write and compile the code in visual studio (parallels) on a shared folder on the mac. From that shared folder, I simply run the assembly. Here is my code (note that it works when using cocoa-sharp). using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; using Cocoa; namespace monobjc_menulet { class Program { static void Main(string[] args) { runMonobjc(); //runCocoaSharp(); } private static void runCocoaSharp() { Application.Init(); Application.LoadNib("Menulet.nib"); Application.Run(); } private static void runMonobjc() { ObjectiveCRuntime.LoadFramework("Cocoa"); ObjectiveCRuntime.Initialize(); NSApplication.Bootstrap(); NSApplication.LoadNib("Menulet.nib"); NSApplication.RunApplication(); } } } And this is the output I get on the command line : [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ ls Menulet.nibcocoa-sharp.dll monobjc-menulet.vshost.exe Monobjc.Cocoa.dll monobjc-menulet.exe Monobjc.dllmonobjc-menulet.pdb [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ mono monobjc-menulet.exe 633579391323136830 [ERROR] NSApplication - Error while loading the NIB file ^C [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ Does anyone of you knows why this goes wrong ? Many thanks in advance, Miguel
[EMAIL PROTECTED] NSApplication.LoadNib() fails.
Hi all, I am new to monobjc (just discovered it), and want to try it out. Nevertheless, I fail to load a nib. My code always returns '633579382263870320 [ERROR] NSApplication - Error while loading the NIB file'. I am on MacOSX 10.4.11 (Tiger) and have mono 1.9.1 installed (latest version). I downloaded monobjc-2.0.272.0 and use the assemblies from under the dist/1.0/ folder. I write and compile the code in visual studio (parallels) on a shared folder on the mac. From that shared folder, I simply run the assembly. Here is my code (note that it works when using cocoa-sharp). using System; using System.Collections.Generic; using System.Text; using Monobjc; using Monobjc.Cocoa; using Cocoa; namespace monobjc_menulet { class Program { static void Main(string[] args) { runMonobjc(); //runCocoaSharp(); } private static void runCocoaSharp() { Application.Init(); Application.LoadNib("Menulet.nib"); Application.Run(); } private static void runMonobjc() { ObjectiveCRuntime.LoadFramework("Cocoa"); ObjectiveCRuntime.Initialize(); NSApplication.Bootstrap(); NSApplication.LoadNib("Menulet.nib"); NSApplication.RunApplication(); } } } And this is the output I get on the command line : [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ ls Menulet.nibcocoa-sharp.dll monobjc-menulet.vshost.exe Monobjc.Cocoa.dll monobjc-menulet.exe Monobjc.dllmonobjc-menulet.pdb [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ mono monobjc-menulet.exe 633579391323136830 [ERROR] NSApplication - Error while loading the NIB file ^C [EMAIL PROTECTED]:~/monobjc-menulet/monobjc-menulet/bin/Debug $ Does anyone of you knows why this goes wrong ? Many thanks in advance, Miguel