[EMAIL PROTECTED] TEST

2008-05-06 Thread Laurent Etiemble
Do not reply, this is a test


Re: [EMAIL PROTECTED] Hello

2008-05-08 Thread Laurent Etiemble
Hello,

At the moment, there are two IDE options:
- MonoDevelop under MacOS X (bundled with Mono 1.9 and higher)
- Visual Studio (2005 or 2008) in VMWare Fusion or Parellels Desktop.

As you come from Windows, you may have already used Visual Studio.
MonoDevelop is a bit frustating compared to Visual Studio, because it lacks
some very neat features (code correction proposal, refactoring, objec
viewer, etc...)

I recommend you using Visual Studio in a virtual machine, and the command
line tool NAnt to build and package applications on the MacOS X side.

Regards from France,
Laurent Etiemble

2008/5/8 José Luis Sánchez Navarro <[EMAIL PROTECTED]>:

> Hello
> I'm a switcher and have been programming for W for several years. I've
> known the monobjc project and want to begin learning it.
> I've downloaded the mono environment for mac and the monobjc, but I have
> any doubts. What IDE have I to use with monobjc ? Have I to learn anything
> about Xcode and Cocoa ? Have I to install the C# plugin for Xcode ?
> I apologize for my english. Regards from Spain,
> José Luis
>
>


[EMAIL PROTECTED] Monobjc 2.0.224.0 has been released

2008-05-24 Thread Laurent Etiemble
Hello,

A new release of Monobjc is available.

This release is focused on the building tools to ease the building and
the packaging of the Monobjc applications. You will also find two new
tutorials to guide you for the creation of a Cocoa application and for
its redistribution. Feedback and remarks are welcomed !!!

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] ApplicationShouldTerminateAfterLastWindowClosed

2008-06-02 Thread Laurent Etiemble
Hello,

It is a NSApplication delegate method. In Interface Builder, connec
the NSApplication delegate outlet to the instance that implements the
method. If you take a look at the NIB of the SearchField sample, you
will see the connection between NSApplication and the controller.

Regards, Laurent Etiemble

2008/6/2 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> I've got a problem trying to ask my application to quit when I close the
> last window.
>
> I've looked at the "SearchField" example and I found this code
>
>
> [ObjectiveCMessage("applicationShouldTerminateAfterLastWindowClosed:")]
> public bool
> ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
> {
> return true;
> }
> So I've added it to my project. But it never gets called. Is there something
> I need to do inside Interface Builder as well?
> Thanks
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


Re: [EMAIL PROTECTED] Meet at WWDC

2008-06-06 Thread Laurent Etiemble
Hi,

Unfortunatly, I am very busy at the moment in Paris (France), Maybe
the next one.

Regards, Laurent Etiemble.

2008/6/6 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> We were discussing on the mono-osx mailing list about a meetup in San
> Francisco during the WWDC for people involved with Mono on Mac OS X.  If any
> of you plans to be there and wants to meet, just let me know.
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


Re: [EMAIL PROTECTED] Threading with multiple arguments

2008-06-07 Thread Laurent Etiemble
Hello,

There is a trick to pass multiple arguments but it only works with
managed wrappers (i.e. NSObject subclasses):
- Create a NSArray with the arguments you want to pass.
- Pass the NSArray instance a the argument of the NSThreadRunner
- Cast back the argument to an NSArray.
- Extract the arguments in the order you have put them.

Regards, Laurent Etiemble.


2008/6/7 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> I've looked at this page to work with threading, very helpful:
> http://www.monobjc.net/index.php?page=multithreading
> The thing is, I need to send multiple arguments (2). What would be the best
> way to implement it since NSThreadRunner only use 1 argument?
> Thanks again for your help.
> (Thanks Laurent for your answer on my previous email, worked great!)
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


[EMAIL PROTECTED] Future of the Monobjc project

2008-06-25 Thread Laurent Etiemble
Hello,

Monobjc is almost one year old now and it is considered as pretty
mature. We are now looking for feedback from the community to set the
future directions of the project.

Here is some suggestions:
- An IDE based on some existing code base (MonoDevelop, Sharp IDE,
etc) that is dedicated to Mac OS X, with a Mac OS X look.
- Support for additionnals API provided by Apple or by a third party
- Tutorials or guides needed to make the .NET use for Mac OS X easier,
simpler, etc.

We are waiting for your suggestions.

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] is mailing list working?

2008-07-17 Thread Laurent Etiemble
Hello,

I have received two confirmations for your inscriptions on June the
30th, and you are listed
as member. The fact you can send mail to list means that your are
subscribed (the lists are closed lists that restrict posting to
members).

Regards, Laurent Etiemble.

2008/7/17 osx <[EMAIL PROTECTED]>:
> Hello.
> I tried to subscribe to both this and developer mailing lists, and while the
> web page said it would send me confirmation emails, I never received them.
> Are the mailing lists working?
> Thank you.
>  - sam -
>


Re: [EMAIL PROTECTED] GC enabled for monobjc on Leopard?

2008-07-17 Thread Laurent Etiemble
Hello,

At the moment, there is no public API to plug into the Objective-C GC,
so Monobjc cannot bridge properly code that is GC enabled. If one day
such API is provided, I think it will be very funny to coordinate the
two GCs to make the bridge work seamlessly ;-)

So for now, Monobjc only runs with frameworks or libraries that don't
use the Objective-C GC.

Regards, Laurent Etiemble.

2008/7/17 osx <[EMAIL PROTECTED]>:
> Hello.
> From what I can gather, Leopard supports garbage collection for Objective C,
> but it is an option that the developer can choose to enable or not in XCode.
> On Leopard, does monobjc run with GC enabled for Objective C objects?  If
> not, is it an option (e.g. some build parameter, or some runtime call at
> program startup)?
> Thank you!
>  - sam -
>


Re: [EMAIL PROTECTED] ObjC app calling Mono library

2008-07-22 Thread Laurent Etiemble
Hello,

The Monobjc project is targeted to Objective-C code access from a .NET
application. That means, that the Mono virtual machine is first
launched and controls invocations to native code.

If I understand what you want, you need the exact opposite. You have
native Objective-C code that calls a .NET library. That means, that
you need a way to execute this .NET library and call its classes and
methods. Then you should take a look at the Dumbarton project.
Informations can be found at
http://anonsvn.mono-project.com/viewcvs/trunk/Dumbarton/.

Here is an excerpt : "Dumbarton is an Objective-C framework that works
as an interface into the Mono C API for embedding. Functionally, it
works like an ObjC<->C# language bridge. It was originally written in
order to bring imeem (http://www.imeem.com) to OS X to allow for the
usability of a native Cocoa application without requiring developers
to reimplement the core code that had already been written for the
Windows client that had been written in C#/.NET. "

Hope it helps.

Regards, Laurent Etiemble


2008/7/21 Duane Wandless <[EMAIL PROTECTED]>:
> Hello all... this project looks very promising.  I am trying to write a C#
> library that will be called from an existing ObjC application.  I had found
> this web page:
> http://www.mono-project.com/ObjCSharp
> Which this seems to be going down the path I want, however it has not been
> updated in 2 years.
> I have some common code that needs to run between Mac and Windows.  But the
> UI can be in true native.  All of the examples for monoobjc seem to be the
> C# app runs and has the ability to handle the NIB.  What I want is an ObjC
> app that runs and can invoke my C# library.
> Can anyone point me in the right direction?
> Thanks.
>
>


Re: [EMAIL PROTECTED] NSDocument

2008-07-25 Thread Laurent Etiemble
Hello,

Look's like your are missing a class description or a nib name. Here
some points to check:
- In your Info.plist file, have you set the right Document subclass
(under the  tag) ?
- Is the NIB filename correct in your NSDocument subclass (the return
of the windowNibName method) ?

For more hints, check the "Introduction to Document-Based Applications
Overview" at 
http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Documents.pdf

Regards, Laurent Etiemble.


2008/7/25 Ben Martin <[EMAIL PROTECTED]>:
> Hi,
>
> I am looking port my .NET to Mac OS with monobjc.  I have been trying to
> create a multi document application.
>
> Looking at the examples I have been able to build a working app, however
> when my app runs is does not open a new document and the new document menu
> item is greyed out.
>
> I have copied the examples QTTimePlayer and The CustomSave.  I am building
> the exe from VS2008 on windows.
>
>
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>
> TruStorm Software
>
> http://www.trustorm.com.au
>
> 0407 256 072


Re: [EMAIL PROTECTED] NSDocumentController

2008-07-30 Thread Laurent Etiemble
Hello,

There is no such example in the Monobjc sample, but I am sure that you
can find an example in Objective-C and port it to .NET. Be careful
when overriding methods and calling super implementation (use Monobjc
documentation to learn about it)

Here are some useful links:
- 
http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Tasks/SubclassController.html
- http://www.monobjc.net/index.php?page=exposing-net-class
- http://www.monobjc.net/index.php?page=messaging

Regards, Laurent Etiemble.

2008/7/30 Ben Martin <[EMAIL PROTECTED]>:
> Hi,
>
> Is there any examples using a subclassed NSDocumentController with Monobjc?
>
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>
> TruStorm Software
>
> http://www.trustorm.com.au
>
> 0407 256 072


Re: [EMAIL PROTECTED] NSDocument

2008-07-30 Thread Laurent Etiemble
Hello,

This is a known bug, and it only occurs on Leopard. I am still
searching a work around as it seems related to command line parsing of
arguments.

Regards, Laurent Etiemble.

2008/7/28 Ben Martin <[EMAIL PROTECTED]>:
> Yes, the info.plist was missing the NSDocument information.
>
> When the app loads a error message is displayed that "The document 
> "[app].exe" could not be open. The [app] cannot open files in the "Document" 
> format."  This happens for the QTKitPlayer and CustomSave example too.
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> ____
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Laurent Etiemble 
> [EMAIL PROTECTED]
> Sent: Friday, 25 July 2008 10:03 PM
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] NSDocument
>
> Hello,
>
> Look's like your are missing a class description or a nib name. Here
> some points to check:
> - In your Info.plist file, have you set the right Document subclass
> (under the  tag) ?
> - Is the NIB filename correct in your NSDocument subclass (the return
> of the windowNibName method) ?
>
> For more hints, check the "Introduction to Document-Based Applications
> Overview" at 
> http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Documents.pdf
>
> Regards, Laurent Etiemble.
>
>
> 2008/7/25 Ben Martin <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I am looking port my .NET to Mac OS with monobjc.  I have been trying to
>> create a multi document application.
>>
>> Looking at the examples I have been able to build a working app, however
>> when my app runs is does not open a new document and the new document menu
>> item is greyed out.
>>
>> I have copied the examples QTTimePlayer and The CustomSave.  I am building
>> the exe from VS2008 on windows.
>>
>>
>>
>>
>> Regards,
>>
>>
>>
>> Ben Martin
>>
>>
>>
>> TruStorm Software
>>
>> http://www.trustorm.com.au
>>
>> 0407 256 072
>


Re: [EMAIL PROTECTED] .config file

2008-08-01 Thread Laurent Etiemble
Hello,

I came across the same bug two days ago on an MDI application, while
trying to solve the bug #14
(http://tracker.monobjc.net/view.php?id=14). But as for now, I have no
real clue on what is happening.

Here are the leads that I am exploring:
- the executable path is miscalculated, so some piece are not found.
- the library path is miscalculated, so some piece are not found.
- the Info.plist is not correctly parsed, so NSDocumentClass are not
found. Weird, as the managed version works well (minus the bug #14).

I will try to investigate further on the issue (need to read again the
"Bundle Architecture" reference from Apple), but let me know if you
have any clues that can solve the problem.

Regards, Laurent Etiemble.

2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> When I compile my application with a normal "nant" command, and I put my
> application config file (Application.exe.config) into the Resources folder,
> it works well.
> But if I use "nant native", I can't find a way to load my .config file. It
> just doesn't load. What would be the name to use? In what directory?
> Thanks a lot.
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


Re: [EMAIL PROTECTED] .config file

2008-08-01 Thread Laurent Etiemble
Hello,

I have just looked into the  task and realized that assembly
config files are treated differently.

When generating the native executable, the assembly config files are
embedded. This is what happened with the System.Drawing assembly (Excerpt
from the NAnt output) :

[mkbundle]   Embedding /Library/Frameworks/Mono.
framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/
*System.Drawing.dll*
[mkbundle]   Embedding
/Library/Frameworks/Mono.framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/
*System.Drawing.dll.config*

Can you check the output of your NAnt build file to check that your config
file appear in the list ? In this case, you don't need to copy it elsewhere.
Regards, Laurent Etiemble.


2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>

> When I compile my application with a normal "nant" command, and I put my
> application config file (Application.exe.config) into the Resources folder,
> it works well.
> But if I use "nant native", I can't find a way to load my .config file. It
> just doesn't load. What would be the name to use? In what directory?
>
> Thanks a lot.
>
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>
>
>


Re: [EMAIL PROTECTED] New release or SVN?

2008-08-01 Thread Laurent Etiemble
Hello,

I am finalizing the tests on the latest release, so if everything goes ok,
it should be available today or tomorrow.

Regards, Laurent Etiemble.

2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>

> I just looked at the bug tracker and it seems that there many bugs have
> been fixed since the last release. Some of theses bugs are problem that I
> currently have.
> Is there a SVN version that I could try or is there a new release planned
> soon? That would really help me out.
>
> Thanks a lot.
>
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>
>
>


Re: [EMAIL PROTECTED] .config file

2008-08-01 Thread Laurent Etiemble
Hello,

The config file to embed should be in the same folder as the corresponding
assembly (see what happens to System.Drawing). So if you build your exe in
the dir 'foo' folder, you should place a copy of your config file in the
'foo' folder, so it is properly pick up by the  task. This can be
achieved with a  task.

Regards, Laurent Etiemble.

2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>

> Hi!
> It seems it doesn't get embedded. But I'm not sure how I should add the
> .config file inside the nant.build file.
>
>
>  [mkbundle]   Reference found
> file:///Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
> [...]
>  [mkbundle]   Reference found
> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>  [mkbundle]   Reference found
> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>  [mkbundle]   Reference found
> file:///Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
> [...]
>
>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
> [...]
>
>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>
>
>
> Finally what I did
>
> I looked at this variable:
> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
>
> What I got for native was:
> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/data-0x3020.config
>
>
> So I added this line to AwakeFromNib
>
>
> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile =
> "Shufl.exe.config";
>
>
> And now the path is:
>
> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/Shufl.exe.config
>
>
> So I manually move my file over there. It's just a weird place because
> there shouldn't be anything in that directory except for the Contents
> folder.
>
>
> If I don't build with native, it just loads it from the Resources folder
> (same directory as Shufl.exe)
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>
>
> On 08-08-01, at 02:50, Laurent Etiemble wrote:
>
> Hello,
>
> I have just looked into the  task and realized that assembly
> config files are treated differently.
>
> When generating the native executable, the assembly config files are
> embedded. This is what happened with the System.Drawing assembly (Excerpt
> from the NAnt output) :
>
> [mkbundle]   Embedding /Library/Frameworks/Mono.
> framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/
> *System.Drawing.dll*
> [mkbundle]   Embedding
> /Library/Frameworks/Mono.framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/
> *System.Drawing.dll.config*
>
> Can you check the output of your NAnt build file to check that your config
> file appear in the list ? In this case, you don't need to copy it elsewhere.
> Regards, Laurent Etiemble.
>
>
> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>
>> When I compile my application with a normal "nant" command, and I put my
>> application config file (Application.exe.config) into the Resources folder,
>> it works well.
>> But if I use "nant native", I can't find a way to load my .config file. It
>> just doesn't load. What would be the name to use? In what directory?
>>
>> Thanks a lot.
>>
>>
>> Jérôme
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>
>


[EMAIL PROTECTED] [ANN] Monobjc 2.0.243.0 Released

2008-08-02 Thread Laurent Etiemble
Hello,

A new release of Monobjc is available.

This release enhances the robustness of the redistribution tasks, and
corrects various mis-spelled notifications, and mis-typed signatures.
Three new samples have been added, to showcase the wide support of Mac OS X
API available in the Monobjc bridge.

Downloads: http://www.monobjc.net/index.php?page=downloads
Release Notes : http://downloads.monobjc.net/Monobjc-2.0.243.0.txt
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : 
http://www.monobjc.net/index.php?page=samples<http://www.monobjc.net/index.php?page=tutorials>

Feedback and remarks are welcomed !!!

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] [ANN] Monobjc 2.0.243.0 Released

2008-08-03 Thread Laurent Etiemble
Hello,

I knew I was forgetting something during this release !!! There was some
changes in the  task in native mode. I will make a post on the list
to detail them.

Regards, Laurent Etiemble

2008/8/2 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>

> Thanks for releasing it!I do have a problem with it
>
> It works great if I do
> nant
>
> But if I do
> nant native
>
> It doesn't work. I get this error: "You can't open the application "Shufl"
> because it is not supported on this architecture". If I show package
> contents inside the application, the MacOS folder is empty.
>
>
>
> Here's the log, I attach the nant.build file to the email.
>
>
> Indian:ShuflMac indian$ nant native
> NAnt 0.86 (Build 0.86.2898.0; beta1; 12/8/2007)
> Copyright (C) 2001-2007 Gerry Shaw
> http://nant.sourceforge.net
>
> Buildfile: file:///ShuflMac/nant.build
> Target framework: Mono 2.0 Profile
> Target(s) specified: native
>
>
> prepare:
>
> [mkdir] Creating directory '/ShuflMac/build'.
> [mkdir] Creating directory '/ShuflMac/dist'.
> [loadtasks] Scanning assembly "NAnt.Monobjc" for extensions.
>
> native:
>
>   [csc] Compiling 2 files to '/ShuflMac/build/Shufl.exe'.
>   [csc] /ShuflMac/ShuflController.cs(177,30): warning CS0169: The
> private method
> `Monobjc.Shufl.HelloController.LoginCallBack(System.IAsyncResult)' is never
> used
>   [csc] Compilation succeeded - 1 warning(s)
>[ibtool] Compiling XIB file /ShuflMac/en.lproj/MainMenu.xib
>  [mkbundle] Getting references for Shufl.exe...
>  [mkbundle]   Reference added file:///ShuflMac/build/Shufl.exe
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/2.0/mscorlib.dll
>  [mkbundle]   Reference added file:///ShuflMac/lib/Monobjc.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/Mono.Security/2.0.0.0__0738eb9f132ed756/Mono.Security.dll
>  [mkbundle]   Reference added file:///ShuflMac/lib/Monobjc.Cocoa.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
>  [mkbundle]   Reference added file:///ShuflMac/lib/Shufl.Client.dll
>  [mkbundle]   Reference added file:///ShuflMac/lib/Shufl.Common.dll
>  [mkbundle]   Reference added file:///ShuflMac/lib/log4net.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/Mono.Data.Tds/2.0.0.0__0738eb9f132ed756/Mono.Data.Tds.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/Mono.Mozilla/0.2.0.0__0738eb9f132ed756/Mono.Mozilla.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/Mono.Posix/2.0.0.0__0738eb9f132ed756/Mono.Posix.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
>  [mkbundle]   Reference added
> file:///Library/Frameworks/Mono.framework/Versions/1.9.1/lib/mono/gac/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.W

[EMAIL PROTECTED] Changes in the task for native mode in 2.0.243.0

2008-08-03 Thread Laurent Etiemble
Hello,

The new release of Monobjc 2.0.243.0 has introduced some changes in the
native mode:
- no loader is generated in native mode.
- the executable binary and and its libraries should be placed in the MacOS
folder instead of the Resources one.

The Redistribution tutorial has been updated accordingly to reflect this
change: http://www.monobjc.net/index.php?page=redistribution

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] NSScrollView

2008-08-04 Thread Laurent Etiemble
Hello,

Maybe it is just a typo that prevents message passing. Check that:
- the signature are correct
- you have put ObjectiveCMessage attributes on these methods
- you have specified selectors
- the selectors you have specified are correct (they are case
sensitive, and semi-colon are very important)

Ex:
[ObjectiveCMessage("initWithFrame:")]
[ObjectiveCMessage("viewDidMoveToSuperview")]
[ObjectiveCMessage("setFrame:")]

Regards, Laurent Etiemble.

2008/8/4 Ben Martin <[EMAIL PROTECTED]>
>
> Hi,
>
> I am trying to use a NSScrollView with my custom NSView.  I am trying to 
> centre the view to the size of the scroll view.
>
> The custom NSView is not receiving the setFrame, setFrameSize and 
> viewDidMoveToSuperview messages.  I am basing this off the last code on this 
> page http://www.cocoadev.com/index.pl?CenteringInsideNSScrollView.
>
>
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>
> TruStorm Software
>
> http://www.trustorm.com.au
>
> 0407 256 072


Re: [EMAIL PROTECTED] NSDocument

2008-08-04 Thread Laurent Etiemble
Hello,

This seems to be related to command line parsing and whether it is
linked to OS version or to Mono version seems unclear at the moment.

At this time, there is no workaround to make Document based
application work in Managed Mode (which means, with all the assemblies
in the Resources folder). BUT, the problem does not exist when using
the Native Mode (which means, that all the assemblies are embedded in
a native executable). I imagine that you want to redistribute your
application, so the Native Mode is the way to go once your application
is ready.

For more informations:
- http://www.monobjc.net/index.php?page=anatomy-of-an-application
explains the two modes Managed and Native
- http://www.monobjc.net/index.php?page=redistribution explains how to
package your application for redistribution

I have also attached a modified NAnt script for the QTKitPlayer sample
application. Just replace the existing one with this. It will package
it in Native Mode and you will be able to check that the warning has
disappeared. Let me know it it works on your machines.

Regards, Laurent Etiemble

2008/8/4 Ben Martin <[EMAIL PROTECTED]>:
> Hi,
>
> I am having this problem in Tiger.
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> 
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Laurent Etiemble 
> [EMAIL PROTECTED]
> Sent: Wednesday, 30 July 2008 6:17 PM
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] NSDocument
>
> Hello,
>
> This is a known bug, and it only occurs on Leopard. I am still
> searching a work around as it seems related to command line parsing of
> arguments.
>
> Regards, Laurent Etiemble.
>
> 2008/7/28 Ben Martin <[EMAIL PROTECTED]>:
>> Yes, the info.plist was missing the NSDocument information.
>>
>> When the app loads a error message is displayed that "The document 
>> "[app].exe" could not be open. The [app] cannot open files in the "Document" 
>> format."  This happens for the QTKitPlayer and CustomSave example too.
>>
>> Regards,
>>
>> Ben Martin
>>
>> TruStorm Software
>> http://www.trustorm.com.au
>> 0407 256 072
>> 
>> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Laurent Etiemble 
>> [EMAIL PROTECTED]
>> Sent: Friday, 25 July 2008 10:03 PM
>> To: users@lists.monobjc.net
>> Subject: Re: [EMAIL PROTECTED] NSDocument
>>
>> Hello,
>>
>> Look's like your are missing a class description or a nib name. Here
>> some points to check:
>> - In your Info.plist file, have you set the right Document subclass
>> (under the  tag) ?
>> - Is the NIB filename correct in your NSDocument subclass (the return
>> of the windowNibName method) ?
>>
>> For more hints, check the "Introduction to Document-Based Applications
>> Overview" at 
>> http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Documents.pdf
>>
>> Regards, Laurent Etiemble.
>>
>>
>> 2008/7/25 Ben Martin <[EMAIL PROTECTED]>:
>>> Hi,
>>>
>>> I am looking port my .NET to Mac OS with monobjc.  I have been trying to
>>> create a multi document application.
>>>
>>> Looking at the examples I have been able to build a working app, however
>>> when my app runs is does not open a new document and the new document menu
>>> item is greyed out.
>>>
>>> I have copied the examples QTTimePlayer and The CustomSave.  I am building
>>> the exe from VS2008 on windows.
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> Ben Martin
>>>
>>>
>>>
>>> TruStorm Software
>>>
>>> http://www.trustorm.com.au
>>>
>>> 0407 256 072
>>
>


appl.build
Description: Binary data


Re: [EMAIL PROTECTED] Simple Modal Window

2008-08-04 Thread Laurent Etiemble
Hello,

Can you describe it bit more the context ?
Are you trying to create a new NSWindow programmaticaly or by loading a NIB ?
Can you post the snippet of code that leads to the error ?
Have you take a look at
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/WinPanel.pdf
?

Regards, Laurent Etiemble

2008/8/4 Ben Martin <[EMAIL PROTECTED]>:
> Hi,
>
> I am finding it difficult to create a custom modal window for my application
> (new document selection window).  I have tried looking at the apple doc's
> with no luck.
>
> The main problem is creating the instance in .NET and load the nib file.
> The consol shows the error "Selector not recognized [self = 0xb7a0940]"
>
> Any help would be good.
>
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>
> TruStorm Software
>
> http://www.trustorm.com.au
>
> 0407 256 072


Re: [EMAIL PROTECTED] nant native and system.runtime.remoting?

2008-08-05 Thread Laurent Etiemble
Hello,

It is very strange. The log only indicates that the bridge has loaded
a new assembly for parsing (parsing means searching for Objective-C
wrappers). This should not cause any problem, as a lot of assemblies
are parsed.

You should be aware that the native application generation has some limitations:
- runtime loaded assemblies are not seen (and there is no way for the
moment to declare them)
- runtime bound library are not seen (and there is no way for the
moment to declare them)

So, the questions are:
- Do you have any assemblies or native libraries that are loaded at
runtime (think reflection but also P/Invoke) ?
- Can compare the behavior on different machines with and without Mono
installed ?

You can check this link in order to debug the native library loading:
- http://developer.apple.com/technotes/tn2004/tn2124.html#SECDYLD

Regards, Laurent Etiemble.

2008/8/4 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> Hi
> I'm having problem with nant native, when I run on a machine without Mono.
> The application just seems to hang there (I have to force quit after a
> "beach ball of the death" ) when I click to login, it's hard to know what's
> going on but it seems that it's a problem with System.Runtime.Remoting
>
> 633534550301397090 [DEBUG] NSApplication - Running Application
> 633534550324178340 [DEBUG] MessagingGenerator - Generating Messaging Method
> : Monobjc.Dynamic.Messaging.OBJC_MSGSEND [Monobjc_Cocoa_NSDictionary]()
> 633534550346850040 [DEBUG] ObjectiveCRuntime - Domain has loaded the
> 'System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089' assembly
> Terminated
> That's the log I get when I enable debugging.
> Is that enough information or you want me to write a test-application?
> Thanks.
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


Re: [EMAIL PROTECTED] .config file

2008-08-05 Thread Laurent Etiemble
Hello,

Here are the results of my ongoing investigations:
- The embedding seems to be fine. A quick check of the Mono functions
shows that both assemblies and their config files are correctly
stored.
- I came across the following bug report
(https://bugzilla.novell.com/show_bug.cgi?id=MONO80305) that is
related. So, everything seems to be fine in Mono API.
- At runtime, the application behaves as it should EXCEPT that when
the app.config is queried, nothing seems to be returned.

I will continue my investigations to find out why is missing or what
is broken. Let me know if you find something.

Note: I have not checked that DLL config can be accessed. Can you take
a look at this ?

Regards, Laurent Etiemble.

2008/8/4 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> Yes, now it is embedded, at least it looks like it.
>  [mkbundle] Generating native sources...
>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe
>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe.config
> But the .config file still seems not to be read (specific variables
> specified in that file are not read)
> And when I write this in AwakeFromNib
> Console.Write(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
> I get this in the console:
> Aug  4 12:41:14 Indian [0x0-0x2c02c].net.monobjc.samples.Shufl[712]:
> /data-0x2010.config
> Any idea?
> Thanks!
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
> On 08-08-01, at 23:30, Laurent Etiemble wrote:
>
> Hello,
>
> The config file to embed should be in the same folder as the corresponding
> assembly (see what happens to System.Drawing). So if you build your exe in
> the dir 'foo' folder, you should place a copy of your config file in the
> 'foo' folder, so it is properly pick up by the  task. This can be
> achieved with a  task.
>
> Regards, Laurent Etiemble.
>
> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>>
>> Hi!
>> It seems it doesn't get embedded. But I'm not sure how I should add the
>> .config file inside the nant.build file.
>>
>>  [mkbundle]   Reference found
>> file:///Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>> [...]
>>  [mkbundle]   Reference found
>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>  [mkbundle]   Reference found
>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>  [mkbundle]   Reference found
>> file:///Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>> [...]
>>
>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>> [...]
>>
>>  [mkbundle]   Embedding
>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>  [mkbundle]   Embedding
>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>>
>>
>> Finally what I did
>> I looked at this variable:
>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
>> What I got for native was:
>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/data-0x3020.config
>> So I added this line to AwakeFromNib
>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile =
>> "Shufl.exe.config";
>> And now the path is:
>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/Shufl.exe.config
>> So I manually move my file over there. It's just a weird place because
>> there shouldn't be anything in that directory except for the Contents
>> folder.
>> If I don't build with native, it just loads it from the Resources folder
>> (same directory as Shufl.exe)
>> Jérôme
>> [EMAIL PROTECTED]
>>
>>
>>
>> On 08-08-01, at 02:50, Laurent Etiemble wrote:
>>
>> Hello,
>>
>> I have just looked into the  task and realized that assembly
>> config files are treated differently.
>>
>> When generating the native executable, the assembly config files are
>> embedded. This is what happened with the System.Drawing assembly (Excerpt
>> from the NAnt output) :
>>
>> [mkbundle]   Embedding /Library/Frameworks/Mono.
>>
>> framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
>> [mkbundle]   Embedding
>> /Library/Frameworks/Mono.framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.config
>>
>> Can you check the output of your NAnt build file to check that your config
>> file appear in the list ? In this case, you don't need to copy it elsewhere.
>> Regards, Laurent Etiemble.
>>
>>
>> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>>>
>>> When I compile my application with a normal "nant" command, and I put my
>>> application config file (Application.exe.config) into the Resources folder,
>>> it works well.
>>> But if I use "nant native", I can't find a way to load my .config file.
>>> It just doesn't load. What would be the name to use? In what directory?
>>> Thanks a lot.
>>>
>>>
>>> Jérôme
>>> [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>>
>
>
>


Re: [EMAIL PROTECTED] Simple Modal Window

2008-08-08 Thread Laurent Etiemble
Hello,

That's good news. Note that the preferred way to create a
NSWindow/NSPanel is to use a NIB, through a NSWindowController.
NSWindow/NSPanel are rarely (if not) created by hand. In Leopard, you
can also apply this to NSView, with the NSViewController.

Regards, Laurent Etiemble.

2008/8/8 Ben Martin <[EMAIL PROTECTED]>:
> Hi,
>
> I have it working now.  Changed the NSView to a NSWindowController and is 
> working fine.
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> 
> From: Ben Martin [EMAIL PROTECTED]
> Sent: Friday, 8 August 2008 9:52 AM
> To: users@lists.monobjc.net
> Subject: RE: [EMAIL PROTECTED] Simple Modal Window
>
> Hi,
>
> Here is the code I am trying to use.
>
> From Document Controller:
> [ObjectiveCMessage("newDocument:")]
>public override void NewDocument(Id sender)
>{
>NewForm oNewField = NewForm.Create();
>
>if (oNewField != null)
>{
>
> NSApplication.SharedApplication.RunModalForWindow(oNewField.buttonCancel.Window);
>}
>}
>
> The subclass:
> [ObjectiveCClass]
>public class NewForm: NSView
>{
>private static readonly Class NewFormClass = 
> Class.GetClassFromType(typeof(NewForm));
>public NewForm() {}
>public NewForm(IntPtr np) : base(np) {}
>public NewForm(NSString nibName, NSBundle bundle) : base(nibName, 
> bundle) { }
>[ObjectiveCField]
>public NSButton buttonCancel;
>[ObjectiveCField]
>public NSButton buttonNew;
>
>[ObjectiveCMessage("awakeFromNib")]
>public void awakeFromNib()
>{
>Console.WriteLine("NewFieldController: awakeFromNib");
>}
>[ObjectiveCMessage("buttonNew_Clicked:")]
>public void ButtonNewClicked(Id sender)
>{
>// Use a standard alert to display the message
>AppKitFramework.NSRunAlertPanel("buttonNewClicked", "New button 
> clicked", "OK", null, null);
>}
>[ObjectiveCMessage("buttonCancel_Clicked:")]
>public void ButtonCancelClicked(Id sender)
>{
>// Use a standard alert to display the message
>AppKitFramework.NSRunAlertPanel("buttonCancelClicked", "Cancel 
> button clicked", "OK", null, null);
>}
>
>public static NewForm Create()
>{
> //NewForm is the name of the NIB.
>return new NewForm(new NSString("NewForm"), NSBundle.MainBundle);
>}
>}
>
>
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> 
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Laurent Etiemble 
> [EMAIL PROTECTED]
> Sent: Monday, 4 August 2008 6:30 PM
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] Simple Modal Window
>
> Hello,
>
> Can you describe it bit more the context ?
> Are you trying to create a new NSWindow programmaticaly or by loading a NIB ?
> Can you post the snippet of code that leads to the error ?
> Have you take a look at
> http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/WinPanel.pdf
> ?
>
> Regards, Laurent Etiemble
>
> 2008/8/4 Ben Martin <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I am finding it difficult to create a custom modal window for my application
>> (new document selection window).  I have tried looking at the apple doc's
>> with no luck.
>>
>> The main problem is creating the instance in .NET and load the nib file.
>> The consol shows the error "Selector not recognized [self = 0xb7a0940]"
>>
>> Any help would be good.
>>
>>
>>
>> Regards,
>>
>>
>>
>> Ben Martin
>>
>>
>>
>> TruStorm Software
>>
>> http://www.trustorm.com.au
>>
>> 0407 256 072
>


Re: [EMAIL PROTECTED] NSDocumentController

2008-08-08 Thread Laurent Etiemble
Hello,

The unmarshalling of the NSError seems to be problematic (it has a
'out' keyword). I will take a look at this.

Regards, Laurent Etiemble.

2008/8/8 Ben Martin <[EMAIL PROTECTED]>:
> I trying to override OpenUntitledDocumentAndDisplayError but I am get the a 
> exception when the method is called i.e it does not enter my method.
>
> Unhandled Exception: System.Reflection.TargetInvocationException: Exception 
> has been thrown by the target of an invocation. ---> 
> System.InvalidProgramException: Invalid IL code in 
> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
>  (intptr,intptr,bool,intptr): IL_000f: call  0x0a0001ec  at (wrapper 
> native-to-managed) 
> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
>  (intptr,intptr,bool,intptr)
>  at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND 
> [System_Void]():objc_msgSend (intptr,intptr)
>  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke 
> (object,object[])
>  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags 
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, 
> System.Globalization.CultureInfo culture) [0x0] --- End of inner 
> exception stack trace ---
>
>
> The code:
>
> [ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
>public override Id OpenUntitledDocumentAndDisplayError(bool 
> displayDocument, out NSError outError)
>{
>Id oDocId = this.MakeUntitledDocumentOfTypeError("hpf", out 
> outError);
>this.NewDocument (oDocId);
>
>if (displayDocument)
>{
>oDocId.CastTo().MakeWindowControllers();
>oDocId.CastTo().ShowWindows();
>}
>return oDocId;
>}
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> 
> From: Ben Martin [EMAIL PROTECTED]
> Sent: Monday, 4 August 2008 10:45 AM
> To: users@lists.monobjc.net
> Subject: RE: [EMAIL PROTECTED] NSDocumentController
>
> Hi Laurent,
>
> Thank you, the information helped.
>
> Regards,
>
> Ben Martin
>
> TruStorm Software
> http://www.trustorm.com.au
> 0407 256 072
> 
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Laurent Etiemble 
> [EMAIL PROTECTED]
> Sent: Wednesday, 30 July 2008 5:38 PM
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] NSDocumentController
>
> Hello,
>
> There is no such example in the Monobjc sample, but I am sure that you
> can find an example in Objective-C and port it to .NET. Be careful
> when overriding methods and calling super implementation (use Monobjc
> documentation to learn about it)
>
> Here are some useful links:
> - 
> http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Tasks/SubclassController.html
> - http://www.monobjc.net/index.php?page=exposing-net-class
> - http://www.monobjc.net/index.php?page=messaging
>
> Regards, Laurent Etiemble.
>
> 2008/7/30 Ben Martin <[EMAIL PROTECTED]>:
>> Hi,
>>
>> Is there any examples using a subclassed NSDocumentController with Monobjc?
>>
>>
>>
>> Regards,
>>
>>
>>
>> Ben Martin
>>
>>
>>
>> TruStorm Software
>>
>> http://www.trustorm.com.au
>>
>> 0407 256 072
>


Re: [EMAIL PROTECTED] .config file

2008-08-11 Thread Laurent Etiemble
Hello,

I have made more searches about the problem. Unfortunately, I think
that there is a problem within the Mono runtime (something about name
mangling).

To be sure, I have made cross-test with the mkbundle2 command that
comes with Mono. I am trying to trace the problem deep down the Mono
code in order to prepare a bug report for the Mono team with more
details and test cases.

Regards, Laurent Etiemble.

2008/8/6 Laurent Etiemble <[EMAIL PROTECTED]>:
> Hello,
>
> Here are the results of my ongoing investigations:
> - The embedding seems to be fine. A quick check of the Mono functions
> shows that both assemblies and their config files are correctly
> stored.
> - I came across the following bug report
> (https://bugzilla.novell.com/show_bug.cgi?id=MONO80305) that is
> related. So, everything seems to be fine in Mono API.
> - At runtime, the application behaves as it should EXCEPT that when
> the app.config is queried, nothing seems to be returned.
>
> I will continue my investigations to find out why is missing or what
> is broken. Let me know if you find something.
>
> Note: I have not checked that DLL config can be accessed. Can you take
> a look at this ?
>
> Regards, Laurent Etiemble.
>
> 2008/8/4 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
>> Yes, now it is embedded, at least it looks like it.
>>  [mkbundle] Generating native sources...
>>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe
>>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe.config
>> But the .config file still seems not to be read (specific variables
>> specified in that file are not read)
>> And when I write this in AwakeFromNib
>> Console.Write(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
>> I get this in the console:
>> Aug  4 12:41:14 Indian [0x0-0x2c02c].net.monobjc.samples.Shufl[712]:
>> /data-0x2010.config
>> Any idea?
>> Thanks!
>>
>> Jérôme
>>
>> [EMAIL PROTECTED]
>>
>>
>>
>> On 08-08-01, at 23:30, Laurent Etiemble wrote:
>>
>> Hello,
>>
>> The config file to embed should be in the same folder as the corresponding
>> assembly (see what happens to System.Drawing). So if you build your exe in
>> the dir 'foo' folder, you should place a copy of your config file in the
>> 'foo' folder, so it is properly pick up by the  task. This can be
>> achieved with a  task.
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>>>
>>> Hi!
>>> It seems it doesn't get embedded. But I'm not sure how I should add the
>>> .config file inside the nant.build file.
>>>
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>>> [...]
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>>> [...]
>>>
>>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>>> [...]
>>>
>>>  [mkbundle]   Embedding
>>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>>  [mkbundle]   Embedding
>>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>>>
>>>
>>> Finally what I did
>>> I looked at this variable:
>>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
>>> What I got for native was:
>>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/data-0x3020.config
>>> So I added this line to AwakeFromNib
>>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile =
>>> "Shufl.exe.config";
>>> And now the path is:
>>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/Shufl.exe.config
>>> So I manually move my file over there. It's just a weird place because
>>> there shouldn't be anything in that directory except for the Contents
>>> folder.
>>> If I don't build with native, it just loads it from the Resources folder
>>> (same directory as Shufl.exe)
>>> Jérôme
>>> [EMAIL PROTECTED]
>>>
>>>
>>>
>>> On 08-08-01, at 02:50, Laurent Etiemble wrote:
>>>
>>> Hello,
>>>
>>> I have just looked into the  task and realized that assembly
>>> config files are treated differentl

Re: [EMAIL PROTECTED] Mono.Unix.Native.Syscall problem

2008-08-12 Thread Laurent Etiemble
Hello,

I am working on the issue. I will post details in the tracker.

Regards, Laurent Etiemble.

2008/8/13 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
> I'm trying to call this function inside awakefromnib
> Mono.Unix.Native.Stat s =  new Mono.Unix.Native.Stat();
> Mono.Unix.Native.Syscall.stat("/Volumes/Test/RebootScript.sh", out s);
> I get this error, dllimport error.
> Is that related to that issue?
> http://tracker.monobjc.net/view.php?id=85
> Thanks
>
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:
> Unhandled Exception: System.Reflection.TargetInvocationException: Exception
> has been thrown by the target of an invocation. --->
> System.TypeInitializationException: An exception was thrown by the type
> initializer for Mono.Unix.Native.Syscall ---> System.DllNotFoundException:
> /Library/Frameworks/Mono.framework/Versions/1.9.1/lib/libMonoPosixHelper.dylib
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> (wrapper managed-to-native) Mono.Unix.Native.Syscall:_L_ctermid ()
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Mono.Unix.Native.Syscall..cctor () [0x0] --- End of inner exception
> stack trace ---
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Shufl.HelloController.AwakeFromNib () [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Dynamic.Proxies.Monobjc.Shufl.HelloController.AwakeFromNib (IntPtr
> receiver, IntPtr selector) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> (wrapper native-to-managed)
> Monobjc.Dynamic.Proxies.Monobjc.Shufl.HelloController:AwakeFromNib
> (intptr,intptr)
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Boolean](Monobjc_Cocoa_NSString,Monobjc_Cocoa_NSApplication):__native_call
> (intptr,intptr,intptr,intptr)
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Boolean](Monobjc_Cocoa_NSString,Monobjc_Cocoa_NSApplication).objc_msgSend
> (IntPtr receiver, IntPtr selector, Monobjc.Cocoa.NSString ,
> Monobjc.Cocoa.NSApplication ) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
> (object,object[])
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x0] --- End of inner
> exception stack trace ---
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
> parameters) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Generation.MessagingGenerator.SendMessage[Boolean] (System.String
> message, IntPtr receiver, IntPtr selector, System.Object[] parameters)
> [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.ObjectiveCRuntime.SendMessage[Boolean] (IManagedWrapper receiver,
> System.String selector, System.Object[] parameters) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Cocoa.NSBundle.LoadNibNamedOwner (Monobjc.Cocoa.NSString aNibName,
> Monobjc.Id owner) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Cocoa.NSApplication.LoadNib (System.String filename) [0x0]
> Aug 12 19:46:47 Indian [0x0-0x12012].net.monobjc.samples.Shufl[119]:   at
> Monobjc.Shufl.Program.Main (System.String[] args) [0x0]
> Aug 12 19:46:47 Indian com.apple.launchd[72]
> ([0x0-0x12012].net.monobjc.samples.Shufl[119]): Exited with exit code: 1
> Aug 12 19:48:00 Indian com.apple.launchd[72] (0x109820.Locum[125]): Exited:
> Terminated
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>


Re: [EMAIL PROTECTED] nant native and BaseDirectory

2008-08-14 Thread Laurent Etiemble
Hello,

The search path by default is the place where the application is launched
(it is '/' when launched from the Finder). If you launch the application in
the folder where the executable lies, the native library lookup will go
fine.

If you paste this code into your Main method (after
NSApplication.Bootstrap), the lookup path will be the folder where the
executable lies and native libraries will be loaded as planned.

String dir =
Path.GetDirectoryName(NSBundle.MainBundle.ExecutablePath);
Console.WriteLine("D=" + dir);
Directory.SetCurrentDirectory(dir);

I have summarize the steps to embed assemblies that contains DLLImport
attributes (like Mono.Posix):
- embed the assembly in the native executable (Done)
- relocate 'dllmap' element in the assembly config (I am working on it)
- embed the modified assembly config in the native executable (Done)
- copy and relocate the native library declared in the DLLImport attribute
(Done)

I will try to generate an interim build of the NAnt task that do almost
everything for you to test.

Regards

2008/8/14 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>

> That may or may not be related to the problem of finding shared
> libraries...
> I've put that line inside awakefromnib
>
> Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
>
> I get "/" as the base directory, even if my application is not inside the
> volume directory. I get this problem with "nant native".
>
> If I just use "nant" I get:
> Aug 14 13:48:36 Indian [0x0-0x21021].net.monobjc.samples.Shufl[343]:
> /ShuflMac/dist/Shufl.app/Contents/Resources
>
>
>
>
> Jérôme
>
> [EMAIL PROTECTED]
>
>
>
>
>
>


Re: [EMAIL PROTECTED] NSDocumentController

2008-08-16 Thread Laurent Etiemble
Hello,

I have not forgotten your problem, but after some analysis, the problem
seems serious enough to need a big patch in the proxy generator. Meanwhile,
you can try the following untested work-around (I have put bold to
emphasis):

[ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
public override Id OpenUntitledDocumentAndDisplayError(bool displayDocument,
*IntPtr* outError)
{
*// The outError parameter points to a native memory zone that waits for
a NSError pointer*
*// Error will be initialized by the MakeUntitledDocumentOfTypeError
call*
*NSError error = null;*
Id oDocId = this.MakeUntitledDocumentOfTypeError("hpf", out outError);
this.NewDocument (oDocId);

if (displayDocument)
{
oDocId.CastTo().MakeWindowControllers();
oDocId.CastTo().ShowWindows();
}

*// Marshal back the pointer to Objective-C*
*Marshal.WriteIntPtr(outError, error.NativePointer);*

return oDocId;
}

Tell me if it solves your problem, while I am trying to get things fixed in
the bridge.

Regards, Laurent Etiemble


2008/8/8 Laurent Etiemble <[EMAIL PROTECTED]>

> Hello,
>
> The unmarshalling of the NSError seems to be problematic (it has a
> 'out' keyword). I will take a look at this.
>
> Regards, Laurent Etiemble.
>
> 2008/8/8 Ben Martin <[EMAIL PROTECTED]>:
> > I trying to override OpenUntitledDocumentAndDisplayError but I am get the
> a exception when the method is called i.e it does not enter my method.
> >
> > Unhandled Exception: System.Reflection.TargetInvocationException:
> Exception has been thrown by the target of an invocation. --->
> System.InvalidProgramException: Invalid IL code in
> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
> (intptr,intptr,bool,intptr): IL_000f: call  0x0a0001ec  at (wrapper
> native-to-managed)
> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
> (intptr,intptr,bool,intptr)
> >  at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Void]():objc_msgSend (intptr,intptr)
> >  at (wrapper managed-to-native)
> System.Reflection.MonoMethod:InternalInvoke (object,object[])
> >  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
> System.Globalization.CultureInfo culture) [0x0] --- End of inner
> exception stack trace ---
> >
> >
> > The code:
> >
> > [ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
> >public override Id OpenUntitledDocumentAndDisplayError(bool
> displayDocument, out NSError outError)
> >{
> >Id oDocId = this.MakeUntitledDocumentOfTypeError("hpf", out
> outError);
> >this.NewDocument (oDocId);
> >
> >if (displayDocument)
> >{
> >oDocId.CastTo().MakeWindowControllers();
> >oDocId.CastTo().ShowWindows();
> >}
> >return oDocId;
> >}
> >
> > Regards,
> >
> > Ben Martin
> >
> > TruStorm Software
> > http://www.trustorm.com.au
> > 0407 256 072
> > 
> > From: Ben Martin [EMAIL PROTECTED]
> > Sent: Monday, 4 August 2008 10:45 AM
> > To: users@lists.monobjc.net
> > Subject: RE: [EMAIL PROTECTED] NSDocumentController
> >
> > Hi Laurent,
> >
> > Thank you, the information helped.
> >
> > Regards,
> >
> > Ben Martin
> >
> > TruStorm Software
> > http://www.trustorm.com.au
> > 0407 256 072
> > 
> > From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf
> Of Laurent Etiemble [EMAIL PROTECTED]
> > Sent: Wednesday, 30 July 2008 5:38 PM
> > To: users@lists.monobjc.net
> > Subject: Re: [EMAIL PROTECTED] NSDocumentController
> >
> > Hello,
> >
> > There is no such example in the Monobjc sample, but I am sure that you
> > can find an example in Objective-C and port it to .NET. Be careful
> > when overriding methods and calling super implementation (use Monobjc
> > documentation to learn about it)
> >
> > Here are some useful links:
> > -
> http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Tasks/SubclassController.html
> > - http://www.monobjc.net/index.php?page=exposing-net-class
> > - http://www.monobjc.net/index.php?page=messaging
> >
> > Regards, Laurent Etiemble.
> >
> > 2008/7/30 Ben Martin <[EMAIL PROTECTED]>:
> >> Hi,
> >>
> >> Is there any examples using a subclassed NSDocumentController with
> Monobjc?
> >>
> >>
> >>
> >> Regards,
> >>
> >>
> >>
> >> Ben Martin
> >>
> >>
> >>
> >> TruStorm Software
> >>
> >> http://www.trustorm.com.au
> >>
> >> 0407 256 072
> >
>


Re: [EMAIL PROTECTED] NSDocumentController

2008-08-18 Thread Laurent Etiemble
Hello,

Good news. I am working on a patch for this, so you will be able to remove
this workaround when the new release is out.

Regards, Laurent Etiemble.

2008/8/18 Ben Martin <[EMAIL PROTECTED]>

>  Laurent,
>
> The work-around is working fine.  Here is my working code.
>
> [ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
> public Id OpenUntitledDocumentAndDisplayErrorNew(bool displayDocument,
> IntPtr outError)
> {
> // The outError parameter points to a native memory zone that waits for
> a NSError pointer
> // Error will be initialized by the MakeUntitledDocumentOfTypeError
> call
> NSError error = null;
> Id oDocId = this.MakeUntitledDocumentOfTypeError("DocumentType", out
> error);
> if (oDocId != null)
> {
> this.AddDocument(oDocId.CastTo());
>
> if (displayDocument)
> {
>  oDocId.CastTo().MakeWindowControllers();
>  oDocId.CastTo().ShowWindows();
> }
> }
> // Marshal back the pointer to Objective-C
> Marshal.WriteIntPtr(outError, error.NativePointer);
> return oDocId;
> }
>
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>
> TruStorm Software
>
> http://www.trustorm.com.au
>
> 0407 256 072
>   --
> *From:* [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf
> Of Laurent Etiemble [EMAIL PROTECTED]
> *Sent:* Saturday, 16 August 2008 11:38 PM
>
> *To:* users@lists.monobjc.net
> *Subject:* Re: [EMAIL PROTECTED] NSDocumentController
>
>   Hello,
>
> I have not forgotten your problem, but after some analysis, the problem
> seems serious enough to need a big patch in the proxy generator. Meanwhile,
> you can try the following untested work-around (I have put bold to
> emphasis):
>
> [ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
> public override Id OpenUntitledDocumentAndDisplayError(bool
> displayDocument, *IntPtr* outError)
> {
> *// The outError parameter points to a native memory zone that waits
> for a NSError pointer*
> *// Error will be initialized by the MakeUntitledDocumentOfTypeError
> call*
> *NSError error = null;*
> Id oDocId = this.MakeUntitledDocumentOfTypeError("hpf", out outError);
> this.NewDocument (oDocId);
>
> if (displayDocument)
> {
> oDocId.CastTo().MakeWindowControllers();
> oDocId.CastTo().ShowWindows();
> }
>
> *// Marshal back the pointer to Objective-C*
> *Marshal.WriteIntPtr(outError, error.NativePointer);*
>
> return oDocId;
> }
>
> Tell me if it solves your problem, while I am trying to get things fixed in
> the bridge.
>
> Regards, Laurent Etiemble
>
>
> 2008/8/8 Laurent Etiemble <[EMAIL PROTECTED]>
>
>> Hello,
>>
>> The unmarshalling of the NSError seems to be problematic (it has a
>> 'out' keyword). I will take a look at this.
>>
>> Regards, Laurent Etiemble.
>>
>>  2008/8/8 Ben Martin <[EMAIL PROTECTED]>:
>>  > I trying to override OpenUntitledDocumentAndDisplayError but I am get
>> the a exception when the method is called i.e it does not enter my method.
>> >
>> > Unhandled Exception: System.Reflection.TargetInvocationException:
>> Exception has been thrown by the target of an invocation. --->
>> System.InvalidProgramException: Invalid IL code in
>> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
>> (intptr,intptr,bool,intptr): IL_000f: call  0x0a0001ec  at (wrapper
>> native-to-managed)
>> Monobjc.Dynamic.Proxies.Mac.BaseDocumentController:OpenUntitledDocumentAndDisplayError_System_Boolean_Monobjc_Cocoa_NSError&
>> (intptr,intptr,bool,intptr)
>> >  at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
>> [System_Void]():objc_msgSend (intptr,intptr)
>> >  at (wrapper managed-to-native)
>> System.Reflection.MonoMethod:InternalInvoke (object,object[])
>> >  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
>> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
>> System.Globalization.CultureInfo culture) [0x0] --- End of inner
>> exception stack trace ---
>> >
>> >
>> > The code:
>> >
>> > [ObjectiveCMessage("openUntitledDocumentAndDisplay:error:")]
>> >public override Id OpenUntitledDocumentAndDisplayError(bool
>> displayDocument, out NSError outError)
>> >{
>> >Id oDocId = this.MakeUntitledDocumentOfTyp

Re: [EMAIL PROTECTED] Hello and question

2008-08-27 Thread Laurent Etiemble
Hello,

I will take a look at this. Thanks for the feedback.

Regards, Laurent Etiemble.

2008/8/27 David Rivera <[EMAIL PROTECTED]>

> Yeah, after some more playing around, I was able to get it to work like
> that.  I assumed that the event was already being hooked up behind the
> scenes, like the speech synthesizer example, but maybe for ones that are
> defined in the nib file, thats the way it needs to be done.
>
>
>
> On Aug 26, 2008, at 11:15 PM, osx wrote:
>
>  forgot to mention that you'll still have to hook up the text field's
>> delegate to your controller using interface builder.
>> osx writes:
>>
>>> i have not tried the same method you're using, but this other way worked
>>> for me:   [ObjectiveCMessage("controlTextDidChange:")]
>>> public void controlTextDidChange(NSNotification n)
>>> {
>>>  this.OnTextChanged(n);
>>> }  David Rivera writes:
>>>
>>>> Hello!  I'm a new user of monobjc, and I must say, so far I love it!
>>>> Brilliant job!  I am having an issue though, and I'm not sure if I'm just
>>>> doing  something wrong or what.  I am trying to add a handler for the
>>>> CpontrolTextDidChange event on a  NSTextField, but the event never seems to
>>>> fire.  The text field is in  the nib file, not created programatically 
>>>> (that
>>>> might be the issue),  and I have a hooked up outlet for it in my controller
>>>> class.  I can  change the text of the field programatically and manually,
>>>> but neither  way seems to fire off the event.  Any hints as to what I may 
>>>> be
>>>> doing wrong?  Here is my controller class:  [ObjectiveCClass]
>>>>public class AppController : NSObject
>>>>{
>>>>[ObjectiveCField]
>>>>public NSTextField outputText;
>>>>
>>>>public AppController()
>>>>{
>>>>}
>>>>
>>>>public AppController(IntPtr nativePointer) :
>>>> base(nativePointer)
>>>>{
>>>>}
>>>>
>>>>[ObjectiveCMessage("awakeFromNib")]
>>>>public void AwakeFromNib()
>>>>{
>>>>outputText.StringValue = "Awoke from nib";
>>>>
>>>>outputText.ControlTextDidChange +=
>>>> this.OnTextChanged;
>>>>}
>>>>
>>>>public void OnTextChanged(NSNotification n)
>>>>{
>>>>AppKitFramework.NSRunAlertPanel("HelloCocoa",
>>>> String.Format("Text  Changed!"), "OK", null, null);
>>>>}
>>>>
>>>>[ObjectiveCMessage("startClicked:")]
>>>>public void StartClicked(Id sender)
>>>>{
>>>>outputText.StringValue = "Button Clicked";
>>>>}
>>>>}
>>>>
>>>
>


Re: [EMAIL PROTECTED] WebView

2008-08-29 Thread Laurent Etiemble
Hello,

The WebKit wrapper has not been touched recently, so you must have an
up-to-date wrapper.

After digging around in the doc, I think you have spot a (trivial) bug in
Monobjc:
- the 'MainFrameURL' property is marked as available on Mac OS X v10.4.11
and later (see
http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903-30112
)
- the 'MainFrameURL' property is marked as Mac OS X 10.5 only in Monobjc (
http://api.monobjc.net/html/P_Monobjc_WebKit_WebView_MainFrameURL.htm)

You have to run your application on Mac OS X v10.4.11 or later. According to
the stack trace, I think this is not the case. Can you check the Mac OS X
version you are running ?

I will file a bug to mark properly this property in the Monobjc.WebKit.dll
assembly.

Regards, Laurent Etiemble.


2008/8/29 Monobjc Support <[EMAIL PROTECTED]>

> Hello,
>
> The WebKit wrapper has not been touched recently, so you must have an
> up-to-date wrapper.
>
> After digging around in the doc, I think you have spot a (trivial) bug in
> Monobjc:
> - the 'MainFrameURL' property is marked as available on Mac OS X v10.4.11
> and later (see
> http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903-30112
> )
> - the 'MainFrameURL' property is marked as Mac OS X 10.5 only in Monobjc (
> http://api.monobjc.net/html/P_Monobjc_WebKit_WebView_MainFrameURL.htm)
>
> You have to run your application on Mac OS X v10.4.11 or later. According
> to the stack trace, I think this is not the case. Can you check the Mac OS X
> version you are running ?
>
> I will file a bug to marke properly this property in the Monobjc.WebKit.dll
> assembly.
>
> Regards, Laurent Etiemble.
>
>
> 2008/8/29 osx <[EMAIL PROTECTED]>
>
> Does WebView work?  [with previous release of Monobjc --  my Monobjc DLLs
>> are dated Jun 26 -- either your release dates or my install dates]
>> For something simple like:
>>  wv.MainFrameURL = "http://www.google.com";;
>> where wv is hooked up as an outlet in Interface Builder, I get:
>> 2008-08-29 03:30:23.049 web[72370:717] *** -[WebView setMainFrameURL:]:
>> unrecognized selector sent to instance 0x8eb810
>> 2008-08-29 03:30:23.051 web[72370:717] An uncaught exception was raised
>> 2008-08-29 03:30:23.051 web[72370:717] *** -[WebView setMainFrameURL:]:
>> unrecognized selector sent to instance 0x8eb810
>> 2008-08-29 03:30:23.052 web[72370:717] *** Terminating app due to uncaught
>> exception 'NSInvalidArgumentException', reason: '*** -[WebView
>> setMainFrameURL:]: unrecognized selector sent to instance 0x8eb810'
>> Thanks!  I've had no problems with other controls I've used so far.
>>  - sam -
>>
>
>


Re: [EMAIL PROTECTED] WebView

2008-08-29 Thread Laurent Etiemble
Hello,

Do you load the WebKit framework before initializing the bridge ?

You should have the following statements in your main method:

ObjectiveCRuntime.LoadFramework("Cocoa");
*ObjectiveCRuntime.LoadFramework("WebKit");*
ObjectiveCRuntime.Initialize();

Regards, Laurent Etiemble.

2008/8/29 osx <[EMAIL PROTECTED]>

> I tried:
> 1.  get wv.IsFlipped
> 2.  get wv.IsHidden
> 3.  set wv.IsHidden
> 4.  get wv.MainFrame
> #1, #2, and #3 work.  #4 yields similar result as original email (setting
> wv.MainFrameURL).  According to the documentation, #4 only needs OS X v10.2.
>
>  - sam -
>
> Laurent Etiemble writes:
>
>> Hello,
>> The WebKit wrapper has not been touched recently, so you must have an
>> up-to-date wrapper.
>> After digging around in the doc, I think you have spot a (trivial) bug in
>> Monobjc:
>> - the 'MainFrameURL' property is marked as available on Mac OS X v10.4.11
>> and later (see
>>
>> http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903-30112
>> )
>> - the 'MainFrameURL' property is marked as Mac OS X 10.5 only in Monobjc (
>> http://api.monobjc.net/html/P_Monobjc_WebKit_WebView_MainFrameURL.htm)
>> You have to run your application on Mac OS X v10.4.11 or later. According
>> to
>> the stack trace, I think this is not the case. Can you check the Mac OS X
>> version you are running ?
>> I will file a bug to mark properly this property in the Monobjc.WebKit.dll
>> assembly.
>> Regards, Laurent Etiemble.
>>
>> 2008/8/29 Monobjc Support <[EMAIL PROTECTED]>
>>
>>> Hello,
>>> The WebKit wrapper has not been touched recently, so you must have an
>>> up-to-date wrapper.
>>> After digging around in the doc, I think you have spot a (trivial) bug in
>>> Monobjc:
>>> - the 'MainFrameURL' property is marked as available on Mac OS X v10.4.11
>>> and later (see
>>>
>>> http://developer.apple.com/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903-30112
>>> )
>>> - the 'MainFrameURL' property is marked as Mac OS X 10.5 only in Monobjc
>>> (
>>> http://api.monobjc.net/html/P_Monobjc_WebKit_WebView_MainFrameURL.htm)
>>> You have to run your application on Mac OS X v10.4.11 or later. According
>>> to the stack trace, I think this is not the case. Can you check the Mac
>>> OS X
>>> version you are running ?
>>> I will file a bug to marke properly this property in the
>>> Monobjc.WebKit.dll
>>> assembly.
>>> Regards, Laurent Etiemble.
>>>
>>> 2008/8/29 osx <[EMAIL PROTECTED]>
>>> Does WebView work?  [with previous release of Monobjc --  my Monobjc DLLs
>>>
>>>> are dated Jun 26 -- either your release dates or my install dates]
>>>> For something simple like:
>>>>  wv.MainFrameURL = "http://www.google.com";;
>>>> where wv is hooked up as an outlet in Interface Builder, I get:
>>>> 2008-08-29 03:30:23.049 web[72370:717] *** -[WebView setMainFrameURL:]:
>>>> unrecognized selector sent to instance 0x8eb810
>>>> 2008-08-29 03:30:23.051 web[72370:717] An uncaught exception was raised
>>>> 2008-08-29 03:30:23.051 web[72370:717] *** -[WebView setMainFrameURL:]:
>>>> unrecognized selector sent to instance 0x8eb810
>>>> 2008-08-29 03:30:23.052 web[72370:717] *** Terminating app due to
>>>> uncaught
>>>> exception 'NSInvalidArgumentException', reason: '*** -[WebView
>>>> setMainFrameURL:]: unrecognized selector sent to instance 0x8eb810'
>>>> Thanks!  I've had no problems with other controls I've used so far.
>>>>  - sam -
>>>>
>>>
>>>
>>>


[EMAIL PROTECTED] [ANN] Monobjc 2.0.272.0 Released

2008-09-06 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is available (
http://www.monobjc.net/). The Monobjc bridge provides the necessary tools to
develop and run .NET applications (written in C#, VB.NET <http://vb.net/>,
etc.) that interact with Objective-C frameworks and libraries under Mac OS
X. Existing Objective-C classes can be used in .NET code in an almost
transparent manner.

This release brings:
- a better support for Quartz 2D API
- a better support for Core Animation for Mac OS X 10.5
- a better performance by optimizing the messaging native calls
- the support for ISynchronizeInvoke interface (cross-thread calls) for Mac
OS X 10.4
- an enhancement of the redistribution NAnt tasks (arbitrary assembly and
native library can be embedded)

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : 
http://www.monobjc.net/index.php?page=samples<http://www.monobjc.net/index.php?page=tutorials>

Feedback and remarks are welcomed !!!

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] embedding mono libraries issue

2008-09-09 Thread Laurent Etiemble
Hello,

Can you be more precise on the process you have followed to do the embedding
? You say that you have used the 'build.sh -build' command, but Monobjc does
not rely on shell script. It only uses NAnt build files.

Can you also tell us what are the expected output with Mono and the one you
get without Mono ?

Regards, Laurent Etiemble.

2008/9/9 Duane Wandless <[EMAIL PROTECTED]>

> First I am very pleased with the integration monobjc provides.  Excellent
> work.
>
> I have an issue where I am trying to build a no-mono version of my
> application.  Everything seems to work, all the correct libraries are
> embedded and copied in.  I have this very simple test case below.  Note the
> NNN in the URL.  I use build.sh -build.  I then move Mono.framework out of
> the way.  Then when I run my application this error is printed:
> http://www.yahoo.com/nnn
>
> Yes lowercase nnn... and that is the complete error.  No innerexception, no
> other text.  Now if I move Mono.framework back the application runs as
> expected.
>
> Any help will be greatly appreciated.  We very much want to utilize the
> embedded application so we can avoid a full install of Mono.
>
> Thanks,
> Duane
>
> using Monobjc;
> using Monobjc.Cocoa;
> using System;
> using System.Net;
> public static void Main()
> {
>string xmlAddress = "http://www.yahoo.com/NNN";;
>try
>{
>   HttpWebRequest httpReq =
> WebRequest.Create(xmlAddress) as HttpWebRequest;
>}
>catch (Exception err)
>{
>   Console.WriteLine(err.Message);
>}
>
>// Load the Frameworks
>ObjectiveCRuntime.LoadFramework("Cocoa");
> .
>


Re: [EMAIL PROTECTED] calling native Cocoa code

2008-09-12 Thread Laurent Etiemble
Hello,

Yes, I think it is possible.

The XIB only declare soft references to the runtime classes, so there is no
difference if they are provided by an Objective-C library or by an exposed
C# class. The important thing is that the classes must be available in the
Objective-C runtime when the XIB is loaded.

So, the points are:
- put you class in a Objective-C shared library and load it with the
ObjectiveCRuntime (it is like when a framework load)
- embed this library in the bundle by using the relocation feature of the
 task.
- the XIB should load without problem

If you want to access your Objective-C class, you just have to create a C#
wrapper like those found in Monobjc.

Regards, Laurent Etiemble.

2008/9/12 Duane Wandless <[EMAIL PROTECTED]>

> Hello again... I have a new issue.  Is it possible to include native Cocoa
> code in the bundle?  I would like to have a Cocoa objective-C class that is
> hooked up to the same XIB that my C# class is hooked up to.  Different
> elements but within the same XIB.  ideally I'd have the NSTabViewItem
> handled by an objective-C class and an NSArrayController that is handled by
> a C# class.
>
> Is that possible?
>
> Thanks,
> Duane
>


Re: [EMAIL PROTECTED] no DOMDocument ?

2008-09-13 Thread Laurent Etiemble
Hello,

No indeed, it is currently not supported. Do you have a specific use-case ?

Anyway, patches are welcomed ;-)

Regards, Laurent Etiemble.

2008/9/13 osx <[EMAIL PROTECTED]>

> Hello.
> Based on API documentation, it looks like the equivalent of:
>  [[webView mainFrame] DOMDocument]
> is not supported?  Or am I mistaken?
> Thanks!
>  - sam -
>


Re: [EMAIL PROTECTED] error running PDFKitViewer example

2008-09-17 Thread Laurent Etiemble
Hello,

This is a known bug related to the way Mono parse the command line.

I posted a workaround some times ago :
http://www.mail-archive.com/users@lists.monobjc.net/msg00046.html . Let me
know if it works for you.

Regards, Laurent Etiemble.

2008/9/17 Monobjc Support <[EMAIL PROTECTED]>

> Hello,
>
> This is a known bug related to the way Mono parse the command line.
>
> I posted a workaround some times ago :
> http://www.mail-archive.com/users@lists.monobjc.net/msg00046.html . Let me
> know if it works for you.
>
> Regards, Laurent Etiemble.
>
> 2008/9/17 Duane Wandless <[EMAIL PROTECTED]>
>
> The document "PDFKitViewer.exe" could not be opened.  PDFKitViewer cannot
>> open file in the "EXE File" format.
>>
>>
>>
>> I receive this popup message when I run the PDFKitViewer from the samples
>> directory.  I get the same error from my own executable.The Info.plist
>> is essentially the problem but I do not see how to make the message go
>> away.  Below is the Info.plist from PDFKitViewer.
>>
>> thanks,
>> Duane
>>
>>
>>
>> 
>> > http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
>> 
>>   
>> CFBundleDevelopmentRegion
>> English
>> CFBundleDocumentTypes
>> 
>>   
>> CFBundleTypeExtensions
>> 
>>   pdf
>>   PDF
>> 
>> CFBundleTypeMIMETypes
>> 
>>   application/pdf
>> 
>> CFBundleTypeName
>> DocumentType
>> CFBundleTypeOSTypes
>> 
>>   PDF 
>> 
>> CFBundleTypeRole
>> Viewer
>> NSDocumentClass
>> MyPDFDocument
>>   
>> 
>> CFBundleExecutable
>> PDFKitViewer
>> CFBundleIconFile
>> Monobjc
>> CFBundleIdentifier
>> net.monobjc.samples.PDFKitViewer
>> CFBundleInfoDictionaryVersion
>> 6.0
>> CFBundleName
>> PDFKitViewer
>> CFBundlePackageType
>> APPL
>> CFBundleSignature
>> 
>> CFBundleVersion
>> 1.0
>> NSMainNibFile
>> MainMenu
>> NSPrincipalClass
>> NSApplication
>>   
>> 
>>
>>
>


Re: [EMAIL PROTECTED] NSApplication.LoadNib() fails.

2008-09-25 Thread Laurent Etiemble
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
>
>


Re: [EMAIL PROTECTED] Quicktime framework

2008-09-29 Thread Laurent Etiemble
Hello,

The constant you use is missing in the QuickTime wrapper.

Can you file a bug report in the tracker ? Providing values for the
constants would be great. Thanks.

Regards, Laurent Etiemble.

2008/9/28 Mario Alberto Chavez <[EMAIL PROTECTED]>:
> Hello;
> Hope that some one can help me on this, I'm trying to get a list
> of QTMediaTypeVideo devices on my MBP, but with monobjc NSArray always come
> zero:
> NSArray sourceDevices =
> QTCaptureDevice.InputDevicesWithMediaType("QTMediaTypeVideo");
> But if I code it on Xcode and obj-c NSArray come with the right number of
> devices (which is one in my case, isight)
>
> NSArray* sourceDevices =
>
> [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
>
> Seems to be a bug in monobjc
> Thanks in advance
>
> --
> Mario Alberto Chavez
> [EMAIL PROTECTED]
> http://mario-chavez.blogspot.com/
>


Re: [EMAIL PROTECTED] NSApplication.LoadNib() fails.

2008-09-29 Thread Laurent Etiemble
Hello,

To be honest, I didn't even try to use another folder structure. Maybe
this has to do with the way Cocoa-Sharp does its NIB lookup (needs
investigation).

Regards, Laurent Etiemble.

2008/9/26 Miguel De Buf <[EMAIL PROTECTED]>:
> 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
>>>
>>>
>>>
>


Re: [EMAIL PROTECTED] Quicktime framework

2008-09-30 Thread Laurent Etiemble
Hello,

The solution is pretty simple but very tedious when you have hundreds
of constants...
Write a Cocoa console application linked to the QTKit framework with
the following line: NSLog(@"%@", QTMediaTypeVideo);

Regards, Laurent Etiemble.

2008/9/29 Mario Alberto Chavez <[EMAIL PROTECTED]>:
> Laurent;
> Sure I can file a bug report, but my only question is what should be the
> constant values, I ask this because I found their definition on qtmedia.h
> and they are dleclared as follow:
> QTKIT_EXTERN NSString * const QTMediaTypeVideo
> Mario
>
> On Mon, Sep 29, 2008 at 12:05 AM, Laurent Etiemble
> <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> The constant you use is missing in the QuickTime wrapper.
>>
>> Can you file a bug report in the tracker ? Providing values for the
>> constants would be great. Thanks.
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/9/28 Mario Alberto Chavez <[EMAIL PROTECTED]>:
>> > Hello;
>> > Hope that some one can help me on this, I'm trying to get a list
>> > of QTMediaTypeVideo devices on my MBP, but with monobjc NSArray always
>> > come
>> > zero:
>> > NSArray sourceDevices =
>> > QTCaptureDevice.InputDevicesWithMediaType("QTMediaTypeVideo");
>> > But if I code it on Xcode and obj-c NSArray come with the right number
>> > of
>> > devices (which is one in my case, isight)
>> >
>> > NSArray* sourceDevices =
>> >
>> > [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
>> >
>> > Seems to be a bug in monobjc
>> > Thanks in advance
>> >
>> > --
>> > Mario Alberto Chavez
>> > [EMAIL PROTECTED]
>> > http://mario-chavez.blogspot.com/
>> >
>
>
>
> --
> Mario Alberto Chavez
> [EMAIL PROTECTED]
> http://mario-chavez.blogspot.com/
>


Re: [EMAIL PROTECTED] Quicktime framework

2008-09-30 Thread Laurent Etiemble
Hello,

Yes, use NSString.Pinned() please.

You can make a patch in unified format against the latest release as
it contains the source code and attach it in the tracker.

Regards, Laurent Etiemble.

2008/9/30 Mario Alberto Chavez <[EMAIL PROTECTED]>:
> Laurent;
>
> Thanks for the hint.
> Should I make the variables static NSString.Pinned()? and add then to the
> quicktime constants file?
>
> By the way is there a source code repository so that I can make a patch and
> send it back?
>
> Thx
> Mario
>
> On Tue, Sep 30, 2008 at 12:53 PM, Laurent Etiemble
> <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> The solution is pretty simple but very tedious when you have hundreds
>> of constants...
>> Write a Cocoa console application linked to the QTKit framework with
>> the following line: NSLog(@"%@", QTMediaTypeVideo);
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/9/29 Mario Alberto Chavez <[EMAIL PROTECTED]>:
>> > Laurent;
>> > Sure I can file a bug report, but my only question is what should be the
>> > constant values, I ask this because I found their definition on
>> > qtmedia.h
>> > and they are dleclared as follow:
>> > QTKIT_EXTERN NSString * const QTMediaTypeVideo
>> > Mario
>> >
>> > On Mon, Sep 29, 2008 at 12:05 AM, Laurent Etiemble
>> > <[EMAIL PROTECTED]> wrote:
>> >>
>> >> Hello,
>> >>
>> >> The constant you use is missing in the QuickTime wrapper.
>> >>
>> >> Can you file a bug report in the tracker ? Providing values for the
>> >> constants would be great. Thanks.
>> >>
>> >> Regards, Laurent Etiemble.
>> >>
>> >> 2008/9/28 Mario Alberto Chavez <[EMAIL PROTECTED]>:
>> >> > Hello;
>> >> > Hope that some one can help me on this, I'm trying to get a list
>> >> > of QTMediaTypeVideo devices on my MBP, but with monobjc NSArray
>> >> > always
>> >> > come
>> >> > zero:
>> >> > NSArray sourceDevices =
>> >> > QTCaptureDevice.InputDevicesWithMediaType("QTMediaTypeVideo");
>> >> > But if I code it on Xcode and obj-c NSArray come with the right
>> >> > number
>> >> > of
>> >> > devices (which is one in my case, isight)
>> >> >
>> >> > NSArray* sourceDevices =
>> >> >
>> >> > [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
>> >> >
>> >> > Seems to be a bug in monobjc
>> >> > Thanks in advance
>> >> >
>> >> > --
>> >> > Mario Alberto Chavez
>> >> > [EMAIL PROTECTED]
>> >> > http://mario-chavez.blogspot.com/
>> >> >
>> >
>> >
>> >
>> > --
>> > Mario Alberto Chavez
>> > [EMAIL PROTECTED]
>> > http://mario-chavez.blogspot.com/
>> >
>
>
>
> --
> Mario Alberto Chavez
> [EMAIL PROTECTED]
> http://mario-chavez.blogspot.com/
>


[EMAIL PROTECTED] [ANN] Monobjc 2.0.282.0 Released

2008-10-05 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET, etc.) that interact with Objective-C frameworks and libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

This release brings:
- a better support for Cocoa Bindings
- a better support for QuickTime capture classes
- a new construct similar to the 'as' keyword for fail-safe cast
- two new samples that demonstrate QuickTime capture framework and
Core Animation animator

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : http://www.monobjc.net/index.php?page=samples

Feedback and remarks are welcomed !!!

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] An mkbundle with gdiplus.dll

2008-10-16 Thread Laurent Etiemble
Hello,

In Mono 1.9.1, the libgdiplus library mappings are contained in the
System.Drawing.dll.config file, and not in the machine.config. Is this
file still exists ?

Could you post the log of the NAnt build process and take a look at
your build folder: it must contains the config files that have been
modified before their inclusion.

Maybe there is some changes in the Mono 2.0 that breaks the whole
relocating process.

Regards, Laurent Etiemble.

2008/10/15 Anthony Bowker <[EMAIL PROTECTED]>:
> Hi everyone,
>
>
>
> I am having a terrible time building a native binary with mkbundle of my
> Application.  My App uses Monoobjc.Cocoa and System.Drawing.  The latter
> requires gdiplus.dll.
>
>
>
> I am using the MonoFramework-2.0_4 and when Mono is installed on the
> machine, the machine.config file contains these two dllmap lines to help
> apps locate gdiplus.dll:
>
>target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib"
> />
>
>target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib"
> />
>
>
>
> I am using the excellent NAnt.Monobjc.dll mkbundle task to create my native
> binary, with the following fragments:
>
> 
> todir="${macbuild.dir}"
>
> target="MACOSX_10_4"
>
> universal="true"
>
> rebuild="true">
>
>   
>
> 
>
> 
> todir="${mac.dir}"
>
> native="true"
>
> icon="${build.dir}/Mac/MyApp.icns"
>
> infoplist="${build.dir}/Mac/Info.plist">
>
>
>
>   
>
>   
>
> 
>
> 
>
>   
>
>
>
>   
>
>   
>
> 
>
>   
>
> 
>
>
>
> When I add the following element, it correctly copies the libgdiplus.dylib
> and depenedent files to the MacOS folder of my bundle
>
>  file="/Library/Frameworks/Mono.Framework/Versions/2.0/lib/libgdiplus.dylib"
> />
>
>
>
> But when I run the app without Mono installed on the machine, I still get
> the System.DllNotFoundException: gdiplus.dll
>
>
>
> So it is obviously missing the dllmap entries and the embedded mono runtime
> is not able to resolve gdiplus.dll to libgdiplus.dylib (or in fact
> libgdiplus.0.0.0.dylib in this case) to load it from my MacOS directory.
>
>
>
> I have tried creating both an App.config and Machine.config file and
> embedding using the mkbundle task, but Mono still seems unable to either
> load the config files, or use the dllmap entries:
>
> 
>
>   
>
>   
>
> 
>
>
>
> Any help would be very much appreciated!
>
>
>
> Laurent, I noticed your reply to this list on August 11th (subject: .config
> file) in which you mention a possible Mono runtime bug when config files are
> embedded with mkbundle.  Is there any update with this?
>
>
>
> Also, is there any way to programatically set dllmap information, since in
> my code before I use System.Drawing?
>
> I would love to say something like MonoRuntime.DllMaps.Add("gdiplus.dll",
> "libgdiplus.0.0.0.dylib");
>
>
>
> Many thanks,
>
>
>
> Anthony
>
>
>
>
>
>


Re: [EMAIL PROTECTED] How to catch window close event ?

2008-10-16 Thread Laurent Etiemble
Hello,

As stated here (http://www.monobjc.net/index.php?page=events-and-delegates),
there may be some problems with some classes as the Objective-C
runtime may perform aggressive caching on delegate methods.

I am still searching a way to accommodate with this caching while
preserving the flexibility of the .NET event handlers...

Regards, Laurent Etiemble.

2008/10/16 Miguel De Buf <[EMAIL PROTECTED]>:
> 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
>>
>>
>
>
>


Re: [EMAIL PROTECTED] An mkbundle with gdiplus.dll

2008-10-29 Thread Laurent Etiemble
Hello,

I have just installed the Mono 2.0.1. I will take a look at the issue
when I got a moment.

Regards, Laurent Etiemble.

2008/10/27 Anthony Bowker <[EMAIL PROTECTED]>:
> Hi,
>
> Thank you for your quick reply!
>
> With Mono 2.0.1, there is no longer a System.Drawing.dll.config file,
> instead the relevant dllmap elements are in the
> /Library/Frameworks/Mono.framework/Versions/2.0.1/etc/mono/config
>
> I have solved my particular problem, by adding the dllmap information
> explicitly by adding a call to mono_config_parse_memory() to the native C++
> code.  Granted, this isn't a particularly elegant solution.
>
> Anthony
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Laurent Etiemble
> Sent: Thursday, October 16, 2008 9:13 AM
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] An mkbundle with gdiplus.dll
>
> Hello,
>
> In Mono 1.9.1, the libgdiplus library mappings are contained in the
> System.Drawing.dll.config file, and not in the machine.config. Is this
> file still exists ?
>
> Could you post the log of the NAnt build process and take a look at
> your build folder: it must contains the config files that have been
> modified before their inclusion.
>
> Maybe there is some changes in the Mono 2.0 that breaks the whole
> relocating process.
>
> Regards, Laurent Etiemble.
>
> 2008/10/15 Anthony Bowker <[EMAIL PROTECTED]>:
>> Hi everyone,
>>
>>
>>
>> I am having a terrible time building a native binary with mkbundle of my
>> Application.  My App uses Monoobjc.Cocoa and System.Drawing.  The latter
>> requires gdiplus.dll.
>>
>>
>>
>> I am using the MonoFramework-2.0_4 and when Mono is installed on the
>> machine, the machine.config file contains these two dllmap lines to help
>> apps locate gdiplus.dll:
>>
>>   >
> target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib
> "
>> />
>>
>>   >
> target="/Library/Frameworks/Mono.framework/Versions/2.0/lib/libgdiplus.dylib
> "
>> />
>>
>>
>>
>> I am using the excellent NAnt.Monobjc.dll mkbundle task to create my
> native
>> binary, with the following fragments:
>>
>> >
>> todir="${macbuild.dir}"
>>
>> target="MACOSX_10_4"
>>
>> universal="true"
>>
>> rebuild="true">
>>
>>   
>>
>> 
>>
>> >
>> todir="${mac.dir}"
>>
>> native="true"
>>
>> icon="${build.dir}/Mac/MyApp.icns"
>>
>> infoplist="${build.dir}/Mac/Info.plist">
>>
>>
>>
>>   
>>
>>   
>>
>> 
>>
>> 
>>
>>   
>>
>>
>>
>>   
>>
>>   
>>
>> 
>>
>>   
>>
>> 
>>
>>
>>
>> When I add the following element, it correctly copies the libgdiplus.dylib
>> and depenedent files to the MacOS folder of my bundle
>>
>> >
> file="/Library/Frameworks/Mono.Framework/Versions/2.0/lib/libgdiplus.dylib"
>> />
>>
>>
>>
>> But when I run the app without Mono installed on the machine, I still get
>> the System.DllNotFoundException: gdiplus.dll
>>
>>
>>
>> So it is obviously missing the dllmap entries and the embedded mono
> runtime
>> is not able to resolve gdiplus.dll to libgdiplus.dylib (or in fact
>> libgdiplus.0.0.0.dylib in this case) to load it from my MacOS directory.
>>
>>
>>
>> I have tried creating both an App.config and Machine.config file and
>> embedding using the mkbundle task, but Mono still seems unable to either
>> load the config files, or use the dllmap entries:
>>
>> 
>>
>>   
>>
>>   
>>
>> 
>>
>>
>>
>> Any help would be very much appreciated!
>>
>>
>>
>> Laurent, I noticed your reply to this list on August 11th (subject:
> .config
>> file) in which you mention a possible Mono runtime bug when config files
> are
>> embedded with mkbundle.  Is there any update with this?
>>
>>
>>
>> Also, is there any way to programatically set dllmap information, since in
>> my code before I use System.Drawing?
>>
>> I would love to say something like MonoRuntime.DllMaps.Add("gdiplus.dll",
>> "libgdiplus.0.0.0.dylib");
>>
>>
>>
>> Many thanks,
>>
>>
>>
>> Anthony
>>
>>
>>
>>
>>
>>
>
>


[EMAIL PROTECTED] [ANN] Monobjc 2.0.296.0 Released

2008-11-11 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET, etc.) that interact with Objective-C frameworks and libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

This release brings:
- a better support for NSCell subclassing
- new symbols in NSApplication, NSCell, NSEvent and NSScroller
- a fix of the IL generation under Mono 2.0 that prevents Drag and
Drop from working

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : http://www.monobjc.net/index.php?page=samples

Feedback and remarks are welcomed !!!

Regards, Laurent Etiemble.


Re: [EMAIL PROTECTED] transfer data from one window to another ?

2008-11-12 Thread Laurent Etiemble
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.
>


Re: [EMAIL PROTECTED] transfer data from one window to another ?

2008-11-12 Thread Laurent Etiemble
Hello,

When you load a NIB file, you can pass an file's owner parameter. The
file's owner can be configured when you edit the NIB file (by default
it is the NSApplication shared instance).

So, you can try the following:
- Edit the Form2 NIB and define the Form2Controller class as the file's owner.
- In Form1Controller, create an instance of Form2Controller.
- Load the Form2 NIB by passing the instance of Form2Controller as the
file's owner.
-> You have your two controllers that can talk to each other.

This is not the only solution, but this is the spirit. I suggest you
to read 
http://developer.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/BuildingaNibFile/chapter_4_section_1.html#//apple_ref/doc/uid/TP40005344-CH11-SW1
and especially the chapter "Nib File Design Guidelines". It will help
you to understand what to put in the NIB files and how to coordinate
the loading.

Regards, Laurent Etiemble.

2008/11/12 Miguel De Buf <[EMAIL PROTECTED]>:
> 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(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.
>


[EMAIL PROTECTED] Re: "Error Loading NIB file" with Monobjc?

2008-11-15 Thread Laurent Etiemble
Hello,

There are a lot of mistakes that can produce this error. Anyway, could
you check the following points (even if some of them seem trivial):
- Check the code in your main method looks like the one described at
http://www.monobjc.net/index.php?page=bootstrapping .
- Check the structure of your bundle is correct (see
http://www.monobjc.net/index.php?page=anatomy-of-an-application). It
is important to use the correct structure, otherwise the resources are
not found.
- How do you launch your application ? From the Finder or from the
command line ? If from the command line, do you use the startup script
.app/Contents/MacOS/ ?

You can also check your application against one of the sample
application (like SimpleCocoaApp), to see if you can spot a difference
or use it as a starting point. Let me know if you find something.

Regards, Laurent Etiemble.


2008/11/15 marc hoffman <[EMAIL PROTECTED]>:
> question,
>
> i'm giving Monobjc a first spin and it seems that no matter what i do,
> Monobj fails to load my NIB file (which is properly embedded in the
> \Resources folder of my .app), with the message "Error Loading NIB file"
> emitted to the console, and the app shows with an empy main menu and no UI
> (unsurprisingly).
>
> this happens exactly the same whether i specify the proper name of my NIB
> ("Interface.nib") to the LoadNib call, or whether i specify some fantasy
> name ("foo.nib"). i also tried omitting the .nib extension, including the
> "/Resources/" path, etc,. same error. Which makes me think it doesn't
> actually *find* the NIB in the first place (rather than finding but not
> liking it).
>
> my app is virtually identical to an empty working Cocoa# app (except for
> chaged class names & namespaces, and different code in Main(), which works
> fine.
>
> i tried with the latest 2.0.296.0 release, as well as the one before; i'm
> referencing the 2.0 dlls.
>
> any suggestions? what could i be missing?
>
> thanx,
> marc hoffman
>
> RemObjects Software
> The Infrastructure Company
> http://www.remobjects.com
>
>
> On Nov 11, 2008, at 4:01 PM, Laurent Etiemble wrote:
>
>> Hello,
>>
>> We are proud to announce that a new release of Monobjc bridge is
>> available (http://www.monobjc.net/). The Monobjc bridge provides the
>> necessary tools to develop and run .NET applications (written in C#,
>> VB.NET, etc.) that interact with Objective-C frameworks and libraries
>> under Mac OS X. Existing Objective-C classes can be used in .NET code
>> in an almost transparent manner.
>>
>> This release brings:
>> - a better support for NSCell subclassing
>> - new symbols in NSApplication, NSCell, NSEvent and NSScroller
>> - a fix of the IL generation under Mono 2.0 that prevents Drag and
>> Drop from working
>>
>> Downloads: http://www.monobjc.net/index.php?page=downloads
>> Tutorials : http://www.monobjc.net/index.php?page=tutorials
>> Samples : http://www.monobjc.net/index.php?page=samples
>>
>> Feedback and remarks are welcomed !!!
>>
>> Regards, Laurent Etiemble.
>> ___
>> Mono-osx mailing list
>> [EMAIL PROTECTED]
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>


Re: [EMAIL PROTECTED] Re: "Error Loading NIB file" with Monobjc?

2008-11-15 Thread Laurent Etiemble
Hello,

Monobjc is very strict when it comes to NIB loading, so I suspect a
path problem at the startup.

As the only major difference is the packaging, can you try to use the
NAnt tasks to do the packaging ?

You can use the NAnt script use in the sample app as a starting point.
You MUST run the nant command under MacOS X, as during the packaging,
a chmod command is launched to give the startup script the executable
flags.

Regards, Laurent Etiemble.

2008/11/15 marc hoffman <[EMAIL PROTECTED]>:
> Laurent,
>
> There are a lot of mistakes that can produce this error. Anyway, could
> you check the following points (even if some of them seem trivial):
> - Check the code in your main method looks like the one described at
> http://www.monobjc.net/index.php?page=bootstrapping .
>
> the startup code is copied directly from the SimpleCocoa app, only the name
> of the NIB is changed to match what mine is called:
> class method Program.Main;
> begin
>   ObjectiveCRuntime.LoadFramework("Cocoa");
>   ObjectiveCRuntime.Initialize();
>   NSApplication.Bootstrap();
>   NSApplication.LoadNib("Interface.nib");
>   NSApplication.RunApplication();
> end;
> (yes, i use Oxygene/Delphi Prism, not C#, but im 110% certain that that's
> not the problem ;)
>
> - Check the structure of your bundle is correct (see
> http://www.monobjc.net/index.php?page=anatomy-of-an-application). It
> is important to use the correct structure, otherwise the resources are
> not found.
>
> i didn't have the NIB in a en.lproj folder, but beyond that all looks the
> same. i did try moving the NIB to the subfolder, no difference.
>
> - How do you launch your application ? From the Finder or from the
> command line ? If from the command line, do you use the startup script
> .app/Contents/MacOS/ ?
>
> i use MacPack (or the equivalent of it, which we have integrated into Visual
> Studio as part of Prism) to package it up as .app. i then simply
> double-click the app in Finder to start. literally the exact sam setup works
> for Cocoa#.
>
> You can also check your application against one of the sample
> application (like SimpleCocoaApp), to see if you can spot a difference
> or use it as a starting point. Let me know if you find something.
>
> that's the thing - that's where i did start from, and afaict looks
> identical.
> any further ideas?
> marc


Re: [EMAIL PROTECTED] Re: "Error Loading NIB file" with Monobjc?

2008-11-16 Thread Laurent Etiemble
Hello,

It's been a while, but if I remember well, there was a problem with
the Document based applications. I was unable to make them work with
macpack. That's why I decided to rewrite the launch script (you will
notice that when the script creates the symlink to mono binary, it
does it in a different location, so Document based applications work).

Regards, Laurent Etiemble.

2008/11/16 marc hoffman <[EMAIL PROTECTED]>:
> Laurent,
>
>> Monobjc is very strict when it comes to NIB loading, so I suspect a
>> path problem at the startup.
>>
>> As the only major difference is the packaging, can you try to use the
>> NAnt tasks to do the packaging ?
>>
>> You can use the NAnt script use in the sample app as a starting point.
>> You MUST run the nant command under MacOS X, as during the packaging,
>> a chmod command is launched to give the startup script the executable
>> flags.
>
> found the problem - apparently monobjc needs an entirely different launcher
> SH script. i extracyed that from NAnt.Monobjc.dll and added it to our
> MacPack as option, and now it's working fine!
>
> any specific reason you chose to not just work with the "standard" launch
> script ghat Mono's MacPack uses?
>
> yours,
> marc
>


[EMAIL PROTECTED] Re: patch

2008-11-24 Thread Laurent Etiemble
Hello,

Sorry, for the moment, there is no public SVN repository to work
against. Patch can be produced by using two copies of the sources (one
clean and one modified) and running the diff command on them. Don't
worry about indentation.

I will log the patch into the tracker to keep track of the problem.
The next release of Monobjc is scheduled for the first week of
december, and will include your submission.

Meanwhile, can you re-open the bug on the Mono side ? It is marked
resolved, but obviously, it is not.

Regards, Laurent Etiemble

PS: The reply has also been sent on the list.

2008/11/24 yoni shalom <[EMAIL PROTECTED]>:
> Firstly I'd like to commend you on a great project.
> Do you guys have an SVN repository I could work against, at least as a
> reader, would make contributing and submitting patches much easier...
>
> Attached is a fixed code file for this :
> http://www.mail-archive.com/users@lists.monobjc.net/msg00126.html
>
>
> Thanks,
> Yoni Shalom
>
>
>
>
>


Re: [EMAIL PROTECTED] Marshaling of NSArray containing NSString

2008-11-25 Thread Laurent Etiemble
Hello,

You cannot use .NET keywords reliably on Monobjc wrappers (as they are
wrappers around native pointers). If you want to cast (safely or not),
use the CastAs() and CastTo() methods:
args.objectAtIndex(0).CastAs().

Regards, Laurent Etiemble.

2008/11/25 yoni shalom <[EMAIL PROTECTED]>:
> managed class contains :
>
> [ObjectiveCMessage("func:")]
> public Id InvokeApplication(NSArray args)
> {
>  Console.WriteLine(args.objectAtIndex(0) is NSString);
> }
>
> There is a call from objective c to this function, using an NSArray which
> contains an NSString.
>
> if that NSString in objective-c is an empty string (i.e. ""), the result of
> running this code is "true"
> if that NSString in objective-c isn't empty (i.e. "bla"), the result of
> running this code is "false", which in my scenario is a problem.
>
> Any suggestions? Workarounds?
>


Re: [EMAIL PROTECTED] Marshaling of NSArray containing NSString

2008-11-26 Thread Laurent Etiemble
Hello,

I don't understand what you are trying to achieve. Can you provide an
example of the code you would like to have ?

Some useful infos:
- CastTo() is a unsafe cast (it throws an exception if the cast fails)
- CastAs() is a failsafe cast (returns null if the cast fails)
- Class.Name is not reliable because of toll-free (NSCFString,
NSCFError, ...) and cluster (NSArray and NSMutableArray both returns
NSArray) classes.
- Use "IsKindOfClass" message if you want to test class compatiblity.
- The wrapper creation/retrieval is done by the generic method
GetInstance in ObjectiveCRuntime.Instance.cs.

Regards, Laurent Etiemble.

2008/11/26 yoni shalom <[EMAIL PROTECTED]>:
> In my scenario, the type is not known until runtime.
> Currently, I indeed perform a cast according to a switch on
> IdObject.Class.Name, but it would be best if the framework could do this for
> me when the wrapper is generated, so that the correct wrapper would be
> instantiated instead of Id.
>
> If you could point me to the area in source where this occurs I'm willing to
> take a look and try to think of a patch...
>
> Thanks, Yoni.
>
> On Tue, Nov 25, 2008 at 6:29 PM, Laurent Etiemble
> <[EMAIL PROTECTED]> wrote:
>>
>> Hello,
>>
>> You cannot use .NET keywords reliably on Monobjc wrappers (as they are
>> wrappers around native pointers). If you want to cast (safely or not),
>> use the CastAs() and CastTo() methods:
>> args.objectAtIndex(0).CastAs().
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/11/25 yoni shalom <[EMAIL PROTECTED]>:
>> > managed class contains :
>> >
>> > [ObjectiveCMessage("func:")]
>> > public Id InvokeApplication(NSArray args)
>> > {
>> >  Console.WriteLine(args.objectAtIndex(0) is NSString);
>> > }
>> >
>> > There is a call from objective c to this function, using an NSArray
>> > which
>> > contains an NSString.
>> >
>> > if that NSString in objective-c is an empty string (i.e. ""), the result
>> > of
>> > running this code is "true"
>> > if that NSString in objective-c isn't empty (i.e. "bla"), the result of
>> > running this code is "false", which in my scenario is a problem.
>> >
>> > Any suggestions? Workarounds?
>> >
>
>


Re: [EMAIL PROTECTED] Data binding

2008-11-26 Thread Laurent Etiemble
Hello,

You must return a subclass of Id, thus a NSString instead of String.
Cast it to NSString (there is an implicit conversion).

Regards, Laurent Etiemble.

2008/11/26 Mario De Clippeleir <[EMAIL PROTECTED]>:
> Hi,
>
>
>
> I am trying to bind a DataSource to a TableView, but when trying to get the
> objectValueForTableColumn, I get an error :
>
> """"
>
>  item added
>
> numberOfRows call
>
> reloaded
>
> get Object
>
> Stacktrace:
>
>   at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Void]().objc_msgSend (intptr,intptr) <0x4>
>
>   at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Void]().objc_msgSend (intptr,intptr) <0x>
>
>   at (wrapper runtime-invoke) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
> [System_Void]().runtime_invoke_void_intptr_intptr
> (object,intptr,intptr,intptr) <0x>
>
>   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
> (object,object[],System.Exception&) <0x4>
>
>   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke
> (object,object[],System.Exception&) <0x>
>
>   at System.Reflection.MonoMethod.Invoke
> (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
> <0x000b5>
>
>   at System.Reflection.MethodBase.Invoke (object,object[]) <0x00020>
>
>   at Monobjc.Generation.MessagingGenerator.SendMessage
> (string,intptr,intptr,object[]) <0x0010b>
>
>   at Monobjc.ObjectiveCRuntime.SendMessage
> (Monobjc.IManagedWrapper,string,object[]) <0x00070>
>
>   at Monobjc.Cocoa.NSApplication.Run () <0x0002b>
>
>   at Monobjc.Cocoa.NSApplication.RunApplication () <0x0004b>
>
>   at TestCocoaGui.Program.Main (string[]) <0x00034>
>
>   at (wrapper runtime-invoke)
> TestCocoaGui.Program.runtime_invoke_void_string[]
> (object,intptr,intptr,intptr) <0x>
>
> Abort trap
>
> """
> What causes this ? The object i am returning is a string...
> Thx,
> Mario
>
>
>
>
>
> From: Duane Wandless [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 21 november 2008 16:51
> To: users@lists.monobjc.net
> Subject: Re: [EMAIL PROTECTED] Data binding
>
>
>
> Not knowing what you have accomplished already I will briefly describe what
> I have done.  When I find time I'll post something with pictures.  My main
> application is a Cocoa ObjC app that controls the GUI.  When the app starts
> the very first thing I do is load my C# EXE, note not a DLL.  A bug/issue
> exists that loading a DLL does not completely init the mono environment.
>
> Using Monobjc I export my C# classes to the Cocoa world.  This is why the
> mono executable must be properly initialized first, so that when the NIB
> files are loaded by Cocoa it will find my registered mono classes.
>
> In the NIB file I add an NSObject and set the class to be the name of my C#
> class, say MonoObject.  Add some class outlets to the MonoObject in the NIB
> file that point to array/tree controllers within that NIB file.  The tree
> controller's mode should be class and the class name most likely will be
> NSMutableDictionary, though it can be a class defined in mono as well.  You
> can add keys to these controllers to make binding easier on the table
> views.  Speaking of the table views, you simply point them to the tree
> controller and bind as usual.
>
> Back in your C# class you will have a NSTreeController variable that is
> hooked up by monobjc to the tree controller in the NIB file.  Whenver
> appropriate you can, from within C#, clear the tree controller data, add
> data, remove data etc.  I call something like
> treeController.addObject() where myobject is an instance of a C#
> class.  That class then must register the methods to expose the keys you
> have setup in the tree controller.
>
> You most likely will need to send a reload data notification to the views
> that use these tree controllers.  So you should also set class outlets that
> point to these views so that you can send them reload data messages.
> PostNotification is a nice way to send messages to your mono class so that
> it can load the data as needed.
>
> Another solution is to set your table view's/outline view's datasource to be
> MonoObject.  Just provide the datasource methods in your C# class.  I have
> not implemented this way but I think I'm leaning toward switching.
>
> Not a lot of detail here but hopefully it helps.
> Duane
>
> On Fri, Nov 21, 2008 at 9:44 AM, Mario De Clippeleir <[EMAIL PROTEC

Re: [EMAIL PROTECTED] Data binding

2008-11-27 Thread Laurent Etiemble
Hello,

I think your method signature is wrong. It should returns an Id:

[ObjectiveCMessage("tableView:objectValueForTableColumn:row:")]
public *Id *objectValueForTableColumn(NSTableView aTableView, NSTableColumn
aTableColumn, int rowIndex)

See NSTableDataSource reference to get the signatures (
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSTableDataSource_Protocol/Reference/Reference.html#//apple_ref/doc/uid/2122-BCIJJEBC
)

Regards, Laurent Etiemble.

2008/11/27 Mario De Clippeleir <[EMAIL PROTECTED]>:
> Hi,
>
> This is still not working... The same error exists...
>
> This is the method that causes the error :
>
>
>  [ObjectiveCMessage("tableView:objectValueForTableColumn:row:")]
>public object objectValueForTableColumn(NSTableView
> aTableView,NSTableColumn aTableColumn,int rowIndex)
>{
>Console.WriteLine("get Object");
>Console.WriteLine(items[rowIndex]);
>NSString testString = (NSString) items[rowIndex];
>Console.WriteLine(testString.Length);
>return testString;
>}
>
> Thanks,
>
> Mario
> On 26 Nov 2008, at 18:57, Laurent Etiemble wrote:
>
>> Hello,
>>
>> You must return a subclass of Id, thus a NSString instead of String.
>> Cast it to NSString (there is an implicit conversion).
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/11/26 Mario De Clippeleir <[EMAIL PROTECTED]>:
>>>
>>> Hi,
>>>
>>>
>>>
>>> I am trying to bind a DataSource to a TableView, but when trying to get
>>> the
>>> objectValueForTableColumn, I get an error :
>>>
>>> """"
>>>
>>> item added
>>>
>>> numberOfRows call
>>>
>>> reloaded
>>>
>>> get Object
>>>
>>> Stacktrace:
>>>
>>>  at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
>>> [System_Void]().objc_msgSend (intptr,intptr) <0x4>
>>>
>>>  at (wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
>>> [System_Void]().objc_msgSend (intptr,intptr) <0x>
>>>
>>>  at (wrapper runtime-invoke) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
>>> [System_Void]().runtime_invoke_void_intptr_intptr
>>> (object,intptr,intptr,intptr) <0x>
>>>
>>>  at (wrapper managed-to-native)
>>> System.Reflection.MonoMethod.InternalInvoke
>>> (object,object[],System.Exception&) <0x4>
>>>
>>>  at (wrapper managed-to-native)
>>> System.Reflection.MonoMethod.InternalInvoke
>>> (object,object[],System.Exception&) <0x>
>>>
>>>  at System.Reflection.MonoMethod.Invoke
>>>
>>>
(object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo)
>>> <0x000b5>
>>>
>>>  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00020>
>>>
>>>  at Monobjc.Generation.MessagingGenerator.SendMessage
>>> (string,intptr,intptr,object[]) <0x0010b>
>>>
>>>  at Monobjc.ObjectiveCRuntime.SendMessage
>>> (Monobjc.IManagedWrapper,string,object[]) <0x00070>
>>>
>>>  at Monobjc.Cocoa.NSApplication.Run () <0x0002b>
>>>
>>>  at Monobjc.Cocoa.NSApplication.RunApplication () <0x0004b>
>>>
>>>  at TestCocoaGui.Program.Main (string[]) <0x00034>
>>>
>>>  at (wrapper runtime-invoke)
>>> TestCocoaGui.Program.runtime_invoke_void_string[]
>>> (object,intptr,intptr,intptr) <0x>
>>>
>>> Abort trap
>>>
>>> """
>>> What causes this ? The object i am returning is a string...
>>> Thx,
>>> Mario
>>>
>>>
>>>
>>>
>>>
>>> From: Duane Wandless [mailto:[EMAIL PROTECTED]
>>> Sent: vrijdag 21 november 2008 16:51
>>> To: users@lists.monobjc.net
>>> Subject: Re: [EMAIL PROTECTED] Data binding
>>>
>>>
>>>
>>> Not knowing what you have accomplished already I will briefly describe
>>> what
>>> I have done.  When I find time I'll post something with pictures.  My
>>> main
>>> application is a Cocoa ObjC app that controls the GUI.  When the app
>>> starts
>>> the very first thing I do is load my C# EXE, note 

Re: [EMAIL PROTECTED] Hyperlink in NSTextField

2008-12-03 Thread Laurent Etiemble
Hello,

There is a Apple Technical Q&A for this:
http://developer.apple.com/qa/qa2006/qa1487.html

The port should be straightforward to Monobjc.

Regards, Laurent Etiemble.

2008/12/2 Nico Van Laerebeke <[EMAIL PROTECTED]>

> Hi,
>
> I'm new to monobjc and programming on mac, I'm trying to make a
> hyperlink in a NSTextField.
>
> I think I found that it can be done by using AttributedStringValue and
> setting AllowsEditingTextAttributes and IsSelectable to true.
>
> So something like this:
>
>
>
> [ObjectiveCField]
>
> public NSTextField field = null;
>
>
> [ObjectiveCMessage("awakeFromNib")]
> public override void awakeFromNib() {
>   base.awakeFromNib();
>   field.AllowsEditingTextAttributes = true;
>   field.IsSelectable = true;
>
>NSURL url = new NSURL("http://google.com";);
>NSDictionary dic = new NSDictionary()
>field.AttributedStringValue = new NSAttributedString(url, dic);
> }
>
>
> The code above doesn't work, I'm stuck with the NSDictionary, what do
> I fill it with?
> I hope I got it right at least a bit.
>
>
> Thanks in advance,
> Nico Van Laerebeke
>


Re: [us...@lists.monobjc.net] Numbers only input validation code for using with NSTextField using Monobjc

2008-12-15 Thread Laurent Etiemble
Hello,

Cocoa discourages the subclassing of NSTextField, so delegation to a
formatter is much more better.

For your purpose, you can use the NSNumberFormatter or create your own
NSFormatter subclass. See
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/DataFormatting/Articles/CreatingACustomFormatter.html#//apple_ref/doc/uid/2196or
http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSFormatter_Class/Reference/Reference.html#//apple_ref/doc/uid/2204-DontLinkElementID_4for
details. The NSFormatter class gives you to validate and/or alter the
text field content.

Regards, Laurent Etiemble.

2008/12/15 Nick Ifloat 

> Please help me with building an equivalent to the Numbers only input
> validation code for using with NSTextField using Monobjc.
>
> Case: I want the NSTextField to allow the user to input only numbers(0 to
> 9), '.' and '-' symbols.
>
> Request: Well I am stuck. I am able to handle key press events in Windows
> Forms and Gtk#. But I am new to Mac OS X and need your help with building an
> equivalent method to handle key press events on Mac OS X using Monobjc. I am
> providing my sample code of key press event handler using Windows Forms and
> Gtk# bellow. (I have read about NSFormater, NSCell, NSView's keyDown method
> - but I can't seem to find my way on doing the same using Monobjc!)
>
> Provided: 1. Windows Forms & 2. Gtk# numbers only input sample code.
>
> Need: Monobjc code for numbers only input validation sample code.
>
> //Windows Forms Code to handle KeyPressEvents
>
> private void OnlyNumbers(KeyPressEventArgs e)
>{
>char c = e.KeyChar;
>if (!(c >= '0' && c <= '9' || c == '.' || c == '-' || c == 8))
> //8 is the keycode of the backspace key
>{
>e.Handled = true;
>}
>}
>
> //Then I am calling the method on the text fields KeyPress handler
>
> private void txtNumber_KeyPress(object sender, KeyPressEventArgs e)
>{
>OnlyNumbers(e);
>}
>
> //End of Windows Forms Code
>
> //Gtk# Code to handle/capture & kill Unwanted Keys
>
>   private void OnlyNumbers(object o, Gtk.TextInsertedArgs
> args)//[GLib.ConnectBefore]Gtk.
>{
>try
>{
>Console.WriteLine("text : " +
> args.Text.ToString());
>int pos = ((Entry)o).Position;
>string c = ((Entry)o).GetChars(pos, pos+1);
>char d;
>Char.TryParse(c[0].ToString(), out d);
>if (!(d >= '0' && d <= '9' || d == '.' || d
> == '-'))
>{
>((Entry)o).SelectRegion(pos, pos+1);
>((Entry)o).DeleteSelection();
>}
>}
>catch (System.IndexOutOfRangeException e) {}
>}
>
> //Then I am passing the method to the textfields OnTextInserted event
> handler
>
> protected virtual void txtNumber_OnTextInserted (object o,
> Gtk.TextInsertedArgs args)
>{
>OnlyNumbers(o, args);
>}
> //End of Gtk# code
>


Re: [us...@lists.monobjc.net] Icon View

2008-12-15 Thread Laurent Etiemble
Hello,

You can check this one: http://theocacao.com/document.page/501
Or you can try the IKImageView class, but I think there is no caption under
images.

Regards, Laurent Etiemble.

2008/12/8 Ben Martin 

>  Hi,
>
> I need a Icon View control for my app and found that there is no standard
> control like the ListView in WinForms.
>
> Has anyone made a Icon View with monobjc?
>
>
> Regards,
>
>
>
> Ben Martin
>
>
>


[us...@lists.monobjc.net] [ANN] Monobjc 2.0.313.0 Released

2008-12-17 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET <http://vb.net/>, etc.) that interact with Objective-C frameworks and
libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

This release brings:
- the support of Sparkle <http://sparkle.andymatuschak.org/> update engine
- the ability to embed private frameworks when packaging
- the abiilty to skip assemblies when searching for exposed types
- new symbols for NSSplitterView and NSWindow
- numerous fixes for wrong constants
- a tutorial for Sparkle integration
- two sample applications on CoreAnimation and Sparkle

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : http://www.monobjc.net/index.php?page=samples

Feedback, remarks and donations are welcomed !!!

Regards, Laurent Etiemble.


Re: [us...@lists.monobjc.net] Issues with NSObject.dealloc and NSProxy.dealloc (perhaps dealloc wrappers in general)

2008-12-24 Thread Laurent Etiemble
Hello,

In order to correctly bridge the Objective-C instance lifecycle, Monobjc
inserts itself in the dealloc message hierarchy (see
http://www.monobjc.net/index.php?page=bridging). This way, Monobjc
intercepts all dealloc messages, removes any existing managed wrapper, and
then pass the dealloc message to the original implementation. This trick is
called method swizzling (as used by Cocoa in Bindings); see
http://www.cocoadev.com/index.pl?MethodSwizzling for details.

It seems overkill that ALL dealloc messages are to be intercepted, but I
think this is the only way to synchronize native deallocation and managed
wrapper disposal.

As far as I know, there was no report of error for the NSObject hierarchy.
But for the NSProxy hierarchy, I am not 100% confident about the trick.

Can you attach a sample application that contains only the offending part so
I can reproduce and investigate ?

Regards, Laurent Etiemble.

2008/12/23 yoni shalom 

> I have an application that uses monobjc, embedded under a Cocoa app.
> I have witnessed various timing/threading issues (.net exceptions, SIGSEGV
> | EXC_BAD_ACCESS signals etc) with variouse stacks, for example :
>
> [NSRunloop run]//beginning
> ... //some framework code
> ...
> [NSDistantObject dealloc]
> ??
> ??   //.net JIT compiled function addresses - the .net
> wrappers for NSObject dealloc, or NSProxy dealloc
> ??
> [NSProxy isKindOfClass]
> ...   //some native forwarding...
> ...
> [SIGSEGV handler / native exception handler]
>
> I'm attaching a real example at the end of this post.
> some facts :
>
> 1. The object for which the wrapper-dealloc is called on is NOT A .Net
> monobjc NSObject !  Are all objective-c native objects becoming "wrapped"
> just because we are using Monobjc ?
> 2. If the answer to the previous question is Yes (as it seems from my
> debugging session), I personally see it as a major flaw - bugs in monobjc
> shouldn't affect objects which the developer never intended to instanciate
> .Net managed wrappers for.
>
> 3. The code in the dealloc wrapper causes induces the use of Monitor.Enter,
> which in some occasions causes deadlocks (couldn't figure out why, didn't
> bother on debugging)
> 4. The code in the dealloc wrapper may run AFTER the native ptr is no
> longer valid for some reason, causing the native call to [self dealloc] to
> crash and burn with all kinds of nasty signals and shit.
>
> Removing the function "dealloc" in NSObject and NSProxy wrappers problems
> I've been trying to solve for two days.
> This, again, despite the fact that the objects causing the problem in the
> stack are not .net instances related to my managed embedded stack!, they are
> just regular, native, objective-c objects!
>
>
> A real example (crash report), in which u see WebKit (WebView embedded in
> my app) trying to release an object (note the command on line 10):
>
> Thread 0 Crashed:
> 0   libSystem.B.dylib  0x96f45b9e __kill + 10
> 1   libSystem.B.dylib  0x96fbcec2 raise + 26
> 2   libSystem.B.dylib  0x96fcc47f abort + 73
> 3   libmono.0.0.0.dylib0x0078e999 mono_handle_native_sigsegv +
> 215 (mini-exceptions.c:1366)
> 4   libmono.0.0.0.dylib0x00730ece sigsegv_signal_handler + 226
> (mini.c:13441)
> 5   libSystem.B.dylib  0x96f4409b _sigtramp + 43
> 6   ???0x 0 + 4294967295
> 7   com.apple.CoreFoundation   0x921156bd ___forwarding___ + 237
> 8   com.apple.CoreFoundation   0x92115a12 _CF_forwarding_prep_0 + 50
> 9   com.apple.Foundation   0x937485a0 -[NSProxy isKindOfClass:] +
> 160
> 10  ???0x0304d567 0 + 50648423// >
> somewhere along the ?? functions is Monobjc, trying to execute the managed
> wrapper function NSProxy.Dealloc()!
> 11  ???0x16d00436 0 + 382731318
> 12  ???0x16d0021e 0 + 382730782
> 13  ???0x16d001ac 0 + 382730668
> 14  ???0x02ad0bfa 0 + 44895226
> 15  com.apple.Foundation   0x93708695 -[NSDistantObject dealloc] +
> 117
> 16  com.apple.CoreFoundation   0x9202c823 CFBagApplyFunction + 131
> 17  com.apple.Foundation   0x93748094 invalidateConnection + 596
> 18  com.apple.Foundation   0x93747815 -[NSConnection invalidate] +
> 613
> 19  com.apple.Foundation   0x93740238 +[NSConnection
> _portInvalidated:] + 712
> 20  com.apple.Foundation   0x936c91da _nsnote_callback + 106
> 21  com.apple.CoreFoundation   0x92077aba __CFXNotificationPost + 362
> 22  com.apple.CoreFoundation 

Re: [us...@lists.monobjc.net] Issues with NSObject.dealloc and NSProxy.dealloc (perhaps dealloc wrappers in general)

2008-12-26 Thread Laurent Etiemble
Hello,

The main reason for the managed wrapper cache is to have one and only one
managed wrapper for one native instance: this ensures that whoever create a
native instance, only one managed wrapper exists to represent it.

The managed wrapper creation rules are the following:
- If a native instance is created by .NET, then a managed wrapper is created
at the same time and cached.
- If a native instance is created by Objective-C and passed to .NET, then a
managed wrapper is created at this time and cached.
- If a native instance is created by Objective-C and never passed to .NET,
then no managed wrapper is created.
=> A managed wrapper exists if and only if the native instance it represents
is used in .NET.

To follow these rules, we need an effective lifecycle management to have an
always up-to-date cache. The current lifecycle management, is based on
dealloc message interception. When a native instance is deallocated , the
bridge check if a managed wrapper exists for this instance:
- If a managed wrapper exists for this native instance, it is removed from
the cache and disposed by the GC. Then the message is forwarded to the
original dealloc implementation.
- If no managed wrapper exists for this native instance, the message is
forwarded to the original dealloc implementation.

This appears to be non-optimal, but for the moment, there is no way to know
if a dealloc message is for the bridge or not. The method swizzling can only
be done at the class level, by altering the message dispatch tables. There
is no way to do method swizzling at the instance level. This is why Monobjc
hooks at the highest level of the class hierarchy (in the root classes), to
be sure to intercept every dealloc message (as dealloc message are
guaranteed to climb the class hierarchy), and then decide what to do. Any
other option that can do the job is welcomed.

Regarding the deadlock issue in the UI thread, I will welcome a sample code
that can reproduce the problem, or at least the thread stack traces to
narrow the problem. Maybe it can be solve by narrowing the thread-protected
code.

Regards, Laurent Etiemble.


2008/12/25 yoni shalom 

> As to your first paragraph - I understood the concept completely after my
> debugging session and a few looks at the NSObject wrapper.
>
> Your first paragraph is only true under the following conditions :
>
> 1. If the wrapper objects themselves have underlying managed resources to
> dispose.
> (a. If all the managed dealloc implementation does is call the native
> one, it has no meanning, does it ?)
> (b. At least for NSProxy and NSObject, I don't remember noticing any
> underlying resources needing explicit disposal (pure wrappers)).
>
> 2. If there is no reference to a certain NSObject managed wrapper
> instance anywhere in user code, it should be collected by GC whether or not
> the
> native instance is still alive. on the flip side - deallocation of the
> native instances themselves - The fact that the framework caches these
> instances
> seems to me more like buggy overhead than a performance gain, can this
> be opened for public discussion ?
>
> 3. And most importantly - instantiation of a managed wrapper should only be
> performed for an object that the user code has _explicitly_ exposed to
> .net user code. Correct me if I'm wrong but why should a managed
> instance be created for a native instance of ALL native NSObjects,
> NSProxies,
>  and the other NS classes that have managed wrapper definitions in the
> Monobjc framework...
>
> Regarding your second and third paragraphs - I noticed hangs (deadlocks in
> the main UI thread) and crashes that were related to NSObject dealloc as
> well. I'll try to recreate something that brings the problem to visible
> view, although I'm not sure it'll be that simple...
>
> p.s.
> In the documentation you referenced, (bridging topic in monobjc site), the
> following is stated :
>
> An Objective-C object is wrapped in a managed wrapper only if it is
>> referenced in .NET code. This limits the amount of managed wrappers in .NET
>> runtime.
>>
>
> This entire thread exists due to the fact that this seems not to be true...
> (i.e. webkit objects, appkit objects, foundations objects that were never
> referenced by .net code seem to have wrappers created for them)...
>
> On Wed, Dec 24, 2008 at 2:05 PM, Laurent Etiemble <
> laurent.etiem...@monobjc.net> wrote:
>
>> Hello,
>>
>> In order to correctly bridge the Objective-C instance lifecycle, Monobjc
>> inserts itself in the dealloc message hierarchy (see
>> http://www.monobjc.net/index.php?page=bridging). This way, Monobjc
>> intercepts all dealloc messages, removes any existing managed wrapper, and
>> then pass the dealloc message to the original

Re: [us...@lists.monobjc.net] NSOutlineView

2009-01-14 Thread Laurent Etiemble
Hello,

NSOutlineView is almost the same as NSTableView. Wire the
NSOutlineView to an instance that acts as a datasource and a delegate,
and then responds to message to populate the NSOutlineView.

See:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOutlineView_Class/Reference/Reference.html
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSOutlineViewDataSource_Protocol/Reference/Reference.html#//apple_ref/occ/cat/NSOutlineViewDataSource

As noted in the documentation, the view does not store any data, so
the view asks for data as needed. Your model should typically include
some sort of unique key that is used to identify the data row (you can
use a static int counter). When the NSOutlineView needs to display
something, it will ask for the data by passing the column identifier
and the unique key.

You can also take a look at the Cocoa samples in the SDK. There is a
sample about NSOutlineView.

Regards, Laurent Etiemble.

2009/1/12 Mario De Clippeleir :
> Hi,
>
>
>
> Does anybody have experience with NSOutlineView ? Any examples out there ?
>
>
>
> Br,
>
>
>
> Mario


Re: [us...@lists.monobjc.net] NSOutlineView

2009-01-16 Thread Laurent Etiemble
Hello,

Your class model does not need to be a NSObject subclass. All you need
it to return an Id subclass when asked by the view.
Thanks to explicit casting on some types, it can be done in a simple way:
- A String value can be returned casted as NSString
- An int or long value can be returned casted a NSNumber
- for the other values, it depends on what you want to display. For
the images, I often used named images (NSImage.ImageNamed).

Take a look at the NSNumber and NSString wrapper to see how you can
take advantage of the explicit casting.

Regards, Laurent Etiemble.

2009/1/16 Mario De Clippeleir :
> Hi,
>
> I understand this, but my main concern is : how do i return an item of type
> Id from my own class model ? Should the class inherit from NSObject ?
> Because this is not what i want...
>
> Br,
>
> Mario
> On 14 Jan 2009, at 09:45, Laurent Etiemble wrote:
>
>> Hello,
>>
>> NSOutlineView is almost the same as NSTableView. Wire the
>> NSOutlineView to an instance that acts as a datasource and a delegate,
>> and then responds to message to populate the NSOutlineView.
>>
>> See:
>>
>> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOutlineView_Class/Reference/Reference.html
>>
>> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSOutlineViewDataSource_Protocol/Reference/Reference.html#//apple_ref/occ/cat/NSOutlineViewDataSource
>>
>> As noted in the documentation, the view does not store any data, so
>> the view asks for data as needed. Your model should typically include
>> some sort of unique key that is used to identify the data row (you can
>> use a static int counter). When the NSOutlineView needs to display
>> something, it will ask for the data by passing the column identifier
>> and the unique key.
>>
>> You can also take a look at the Cocoa samples in the SDK. There is a
>> sample about NSOutlineView.
>>
>> Regards, Laurent Etiemble.
>>
>> 2009/1/12 Mario De Clippeleir :
>>>
>>> Hi,
>>>
>>>
>>>
>>> Does anybody have experience with NSOutlineView ? Any examples out there
>>> ?
>>>
>>>
>>>
>>> Br,
>>>
>>>
>>>
>>> Mario
>
>


Re: [us...@lists.monobjc.net] NSBox gradient

2009-02-01 Thread Laurent Etiemble
Hello,

I think subclassing is the only clean way to go: Override the drawRect
method and draw your gradient (NSGradient for Mac OS X 10.5).

Otherwise, you could take a look at:
http://mattgemmell.com/2005/11/02/roundedbox-nsbox-subclass

Regards, Laurent Etiemble.

2009/1/29 Mario De Clippeleir :
> Hi,
>
> Another question : how can you draw a gradient in a NSBox ?
>
> Br,
>
> Mario
>
>


Re: [us...@lists.monobjc.net] KVO constants wrongly defined

2009-02-04 Thread Laurent Etiemble
Hello,

What version of Monobjc are you using ? A lot of constants have been
fixed in the latest version (2.0.313), and NSKeyValueObserving is part
of the fixes. Tell me if you still have the issue with the 2.0.313.

Note that the bug tracking system can be accessed at
http://tracker.monobjc.net and required a registration.

Regards, Laurent Etiemble.

2009/2/4 Joanna Carter :
> Hi folks
>
> I just wanted to confirm a possible bug in the NSKeyValueObserving class.
>
> Using Reflector to check the initialisation of this class, I see the
> following :
>
> static NSKeyValueObserving()
> {
>  NSKeyValueChangeKindKey =
> NSString.NSPinnedString("NSKeyValueChangeKindKey");
>  NSKeyValueChangeNewKey = NSString.NSPinnedString("NSKeyValueChangeNewKey");
>  NSKeyValueChangeOldKey = NSString.NSPinnedString("NSKeyValueChangeOldKey");
>  NSKeyValueChangeIndexesKey =
> NSString.NSPinnedString("NSKeyValueChangeIndexesKey");
> }
>
> Unfortunately, in a test OS X app that implements KVO, I have the following
> method to respond as observer to a property change :
>
> void observeValueForKeyPathOfObjectChangeContext(NSString keyPath, NSObject
> obj, NSDictionary change, Object context)
> {
> NSString keyStr = NSKeyValueObserving.NSKeyValueChangeNewKey;
>
> Id valueId = change[keyStr];
>
> ...
> }
>
> This doesn't work, as the key, which equates to "NSKeyValueChangeNewKey", is
> not found in the change NSDictionary.
>
> However, If I do this :
>
> void observeValueForKeyPathOfObjectChangeContext(NSString keyPath, NSObject
> obj, NSDictionary change, Object context)
> {
> NSString keyStr = "new";
>
> Id valueId = change[keyStr];
>
> ...
> }
>
> I get the expected result of the value for the "new" key.
>
> Is this meant to be like this? If so, how would I get things to work? If
> not, how do I get this submitted to the bug system?
>
> Joanna
>
> --
> Joanna Carter
> Carter Consulting
>
>


Re: [us...@lists.monobjc.net] KVO constants wrongly defined

2009-02-04 Thread Laurent Etiemble
Hello,

Change

Id valueId = change[NSKeyValueObserving.NSKeyValueChangeKindKey];

to

NSNumber value =
change[NSKeyValueObserving.NSKeyValueChangeKindKey].CastTo();

Regards, Laurent Etiemble.

2009/2/4 Joanna Carter :
> Laurent Etiemble a écrit :
>
>> What version of Monobjc are you using ? A lot of constants have been
>> fixed in the latest version (2.0.313), and NSKeyValueObserving is part
>> of the fixes. Tell me if you still have the issue with the 2.0.313.
>
> Thank you Laurent, that fixed that problem.
>
> Now, I just have the problem of casting/converting the Id returned from
this
> code :
>
>  Id valueId = change[NSKeyValueObserving.NSKeyValueChangeKindKey];
>
> ... into an NSNumber.
>
> Any ideas ?
>
> Joanna
>
> --
> Joanna Carter
> Carter Consulting
>
>


Re: [us...@lists.monobjc.net] KVO constants wrongly defined

2009-02-04 Thread Laurent Etiemble
Hello,

The problem lies in the boxing of the value into a NSNumber. Here is a dirty
way:

NSKeyValueChange changeKind = (NSKeyValueChange)
change[NSKeyValueObservingNSKeyValueChangeKindKey].SendMessage("unsignedIntValue");

Regards, Laurent Etiemble.

2009/2/4 Joanna Carter 

> Laurent Etiemble a écrit :
>
>> Hello,
>>
>> Change
>>
>> Id valueId = change[NSKeyValueObserving.NSKeyValueChangeKindKey];
>>
>> to
>>
>> NSNumber value =
>> change[NSKeyValueObserving.NSKeyValueChangeKindKey].CastTo();
>>
>
> Merci Laurent, ça faisait la différence !
>
> But do you have any better ideas on how to avoid a second stage, just to
> get the Id to be an enumeration ?
>
> {
>  Id changeKindAsID = change[NSKeyValueObserving.NSKeyValueChangeKindKey];
>
>  NSNumber changeKindAsNSNumber = changeKindAsID.CastTo();
>
>  NSKeyValueChange changeKind =
> NSKeyValueChange(changeKindAsNSNumber.UnsignedIntValue);
> }
>
> à bientôt
>
>
> Joanna
>
> --
> Joanna Carter
> Carter Consulting
>
>


[us...@lists.monobjc.net] [ANN] Monobjc 2.0.324.0 Released

2009-03-15 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is available (
http://www.monobjc.net/). The Monobjc bridge provides the necessary tools to
develop and run .NET applications (written in C#, VB.NET, etc.) that
interact with Objective-C frameworks and libraries under Mac OS X. Existing
Objective-C classes can be used in .NET code in an almost transparent
manner.

This release brings various fixes and enhancements for the day-to-day
development.

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : http://www.monobjc.net/index.php?page=samples

Feedback, remarks and donations are welcomed !!!

Regards, Laurent Etiemble.


Re: [us...@lists.monobjc.net] PtrToStructure error

2009-03-24 Thread Laurent Etiemble
Hello,

Do you use KVC with fields (i.e. using bindings directly with class field) ?
If yes, have you tried bindings with accessors instead ?
Can you post the classes code (at least the part related to the bindings) ?

Regards, Laurent Etiemble.

2009/3/24 Mario De Clippeleir 

>  Hi,
>
>
>
> I have a textfield, a slider and a checkbox. The textfield and slider are
> connected through bindings using Model Key Path. That works fine, but when I
> change the value (other than the initial one)and then click the checkbox I
> get the following error :
>
> Unhandled Exception: System.NullReferenceException: Object reference not
> set to an instance of an object
>
>   at (wrapper unknown) int:PtrToStructure (intptr,object)
>
>   at (wrapper managed-to-native)
> System.Runtime.InteropServices.Marshal:PtrToStructure(intptr,System.Type)
>
> at
> Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController.ImportMembers(Test.Mac.ApplicationController
> instance) [0x0]
>
>   at
> Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController.CheckClicked(IntPtr
> receiver, IntPtr selector) [0x0]
>
>   at (wrapper
> native-to-managed)Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController:CheckClicked(intptr,intptr)
>
>   at (wrapper managed-to-native) 503BA7BB:pinvoke (intptr,intptr)
>
>   at 503BA7BB.objc_msgSend (IntPtr receiver, IntPtr selector,
> System.Object[] parameters) [0x0]
>
>   at
> Monobjc.Bridge.Generators.DynamicMessagingGenerator.SendMessage(System.String
> message, IntPtr receiver, IntPtr selector, System.Object[] parameters)
> 0x0]
>
>   at Monobjc.ObjectiveCRuntime.SendMessage (IManagedWrapper receiver,
> System.String selector, System.Object[] parameters) [0x0]
>
>   at Monobjc.Cocoa.NSApplication.Run () [0x0]
>
>   at Monobjc.Cocoa.NSApplication.RunApplication () [0x0]
>
>   at Test.Mac.Program.Main (System.String[] args) [0x0]
>
>
>
> What is causing this problem ?
>
>
>
> Br,
>
>
>
> Mario
>


Re: [us...@lists.monobjc.net] PtrToStructure error

2009-03-25 Thread Laurent Etiemble
Hello,

It is better to use accessors, as the support for KVC is easier:

private int myField;

public int MyField {
  [ObjectiveCMessage("myField")]
  get {
return this.myField;
  }
  [ObjectiveCMessage("setMyField:")]
  set {
this.WillChangeValueForKey("myField");
this.myField = value;
this.DidChangeValueForKey("myField");
  }
}

If you use this approach, wherever the changes are made (from
ObjectiveC or from .NET), the bindings will work. I suggest you to
take a look at the CGImageRotation sample code, as it heavily uses
bindings on primitive types.

Regards, Laurent Etiemble.

PS: I think there is a bug with the ivar that are primitive types. The
API is very obscure about the way the storage is done, and my unit
tests are against the official documentation, but the ObjectiveC
runtime is with me. But I have surely missed something...

2009/3/25 Mario De Clippeleir 
>
> Hi,
>
>
>
> I use just a field, which is an “int iValue”.
>
> How should I use the accessors for my purpose ?
>
>
>
> There is nothing in the class code related to the bindings, other then I am 
> initializing the iValue by using SetValueForKey(initValue,”iValue”), which 
> does the trick…
>
>
>
> Br,
>
>
>
> Mario
>
>
>
> From: laurent.etiem...@gmail.com [mailto:laurent.etiem...@gmail.com] On 
> Behalf Of Laurent Etiemble
> Sent: dinsdag 24 maart 2009 22:08
> To: users@lists.monobjc.net
> Subject: Re: [us...@lists.monobjc.net] PtrToStructure error
>
>
>
> Hello,
>
> Do you use KVC with fields (i.e. using bindings directly with class field) ?
> If yes, have you tried bindings with accessors instead ?
> Can you post the classes code (at least the part related to the bindings) ?
>
> Regards, Laurent Etiemble.
>
> 2009/3/24 Mario De Clippeleir 
>
> Hi,
>
>
>
> I have a textfield, a slider and a checkbox. The textfield and slider are 
> connected through bindings using Model Key Path. That works fine, but when I 
> change the value (other than the initial one)and then click the checkbox I 
> get the following error :
>
> Unhandled Exception: System.NullReferenceException: Object reference not set 
> to an instance of an object
>
>   at (wrapper unknown) int:PtrToStructure (intptr,object)
>
>   at (wrapper managed-to-native) 
> System.Runtime.InteropServices.Marshal:PtrToStructure(intptr,System.Type)
>
> at 
> Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController.ImportMembers(Test.Mac.ApplicationController
>  instance) [0x0]
>
>   at 
> Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController.CheckClicked(IntPtr 
> receiver, IntPtr selector) [0x0]
>
>   at (wrapper 
> native-to-managed)Monobjc.Dynamic.Proxies.Test.Mac.ApplicationController:CheckClicked(intptr,intptr)
>
>   at (wrapper managed-to-native) 503BA7BB:pinvoke (intptr,intptr)
>
>   at 503BA7BB.objc_msgSend (IntPtr receiver, IntPtr selector, System.Object[] 
> parameters) [0x0]
>
>   at 
> Monobjc.Bridge.Generators.DynamicMessagingGenerator.SendMessage(System.String 
> message, IntPtr receiver, IntPtr selector, System.Object[] parameters) 
> 0x0]
>
>   at Monobjc.ObjectiveCRuntime.SendMessage (IManagedWrapper receiver, 
> System.String selector, System.Object[] parameters) [0x0]
>
>   at Monobjc.Cocoa.NSApplication.Run () [0x0]
>
>   at Monobjc.Cocoa.NSApplication.RunApplication () [0x0]
>
>   at Test.Mac.Program.Main (System.String[] args) [0x0]
>
>
>
> What is causing this problem ?
>
>
>
> Br,
>
>
>
> Mario
>
>


[us...@lists.monobjc.net] [ANN] Monobjc 2.0.342.0 Released

2009-04-15 Thread Laurent Etiemble
Hello,

We are proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET, etc.) that interact with Objective-C frameworks and libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

This release brings various fixes and enhancements for the day-to-day
development.

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples : http://www.monobjc.net/index.php?page=samples

Feedback, remarks and donations are welcomed !!!

Regards, Laurent Etiemble.


Re: [us...@lists.monobjc.net] using value transformers

2009-04-16 Thread Laurent Etiemble
Hello,

Value transformers are used through an indirection by name (see the
NSValueTransformer documentation). The trick is to register the value
transformer before it is referenced by its name.

You should take a look at the following sample code:
http://developer.apple.com/samplecode/TemperatureTester/index.html#//apple_ref/doc/uid/DTS10003705

The value transformers registration is performed in the "initialize"
static method of the application delegate. When the class is loaded in
the runtime, the value transformers are registered.

Regards, Laurent Etiemble.

2009/4/16 Nico Van Laerebeke :
> I was wondering if/how it was possible to use value transformers in monobjc?
>
> After working with binding I needed a value transformer,  I’ve read
> the apple developer documentation about valuetransformers(
> http://developer.apple.com/documentation/Cocoa/Conceptual/ValueTransformers/ValueTransformers.html
> ) but was not able to get it working.
>
> I’ve tried the following as a simple test:
>
> Creating an NSTestTransformer class by subclassing NSValueTransformer.
>
>
>
> using System;
>
> using Monobjc;
> using Monobjc.Cocoa;
>
> namespace TransformerTest {
>    [ObjectiveCClass]
>    public class NSTestTransformer : NSValueTransformer {
>        public NSTestTransformer() : base() { }
>        public NSTestTransformer(IntPtr native_object) : base(native_object) { 
> }
>
>
>        public Class transformedValueClass {
>            get {
>                return Class.GetClassFromObject(new NSString()); }
>        }
>
>        public bool AllowsReverseTransformation {
>            get {
>                return false;
>            }
>        }
>
>        public Id TransformedValue(Id pValue) {
>            return (new NSString("teststring")).Self;
>        }
>
>        public Id reverseTransformedValue(Id pValue) {
>            return (new NSString("reversetransformedstring")).Self;
>        }
>    }
> }
>
> I think this should be correct, but I'm unsure on how and where to
> register this custom transformer.
>
>
> Any suggestions?
>
>
> Thanks,
> Nico
>


[us...@lists.monobjc.net] Support for the SM2DGraphView framework

2009-04-16 Thread Laurent Etiemble
Hello,

Starting with the 2.0.342.0, Monobjc provides the support for the
SM2DGraphView framework. A new sample application has been added; it
is the straight port of the SM2DGraphView sample that shows how to
deal with the datasources and the delegates.

I have added some warning in the sample code, because of the way
SM2DGraphView process the data for graphs: it requires a binary
marshalling of the NSPoints to a NSData object. A better solution
would be to use a NSArray, with the NSPoints boxed into NSValues. But
this would require to use a custom version of the SM2DGraphView
framework to achieve that.

Anyway, I hope to be able write a full port of SM2DGraphView in .NET
in the near future, so the data providing is easier and faster.

Regard, Laurent Etiemble.


Re: [us...@lists.monobjc.net] Problem building samples

2009-04-20 Thread Laurent Etiemble
Hello,

NAnt is bundled with Mono, so you don't have to install anything else.
Note that some samples require the XCode tools to be installed or some
specific frameworks, but at least 20 of them build out of the box.

Can you try to clean up your setup, and only install Mono ? Once done,
you can check that NAnt is available by opening a Terminal and by
invoking NAnt (type 'nant').

Regards, Laurent Etiemble.

2009/4/17 Ron Grove :
> I've tried to built the samples using nant and get this error message below.
>  I've never used it before and not sure what to do.  This page doesn't tell
> me much:
>
> http://nant.sourceforge.net/release/0.85-rc1/help/functions/pkg-config.exists.html
>
> Where is it looking for the package?  I have the latest download for OS X
> installed on the system.  All the old versions are gone so far as I can see.
>  Somewhere I read to set $PKG_CONFIG_PATH
> to /Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig which
> I've done, but that didn't help.  Any ideas?
>
> Thank you,
> Ron
>
> ---
>
> BUILD FAILED
>
> Failed to initialize the 'Mono 3.5 Profile' (mono-3.5) target framework.
>
>    Function call failed.
> Expression: ${not pkg-config::exists('mono')}
>                  ^^
>
>        'pkg-config' failed to start.
>
>            ApplicationName='pkg-config', CommandLine='--exists mono',
> CurrentDirectory='/Library/Frameworks/Mono.framework/Versions/2.4/share/NAnt/bin/'
>
> For more information regarding the cause of the build failure, run the build
> again in debug mode.
>
>


Re: [us...@lists.monobjc.net] Monobjc & MonoDevelop configuration

2009-04-24 Thread Laurent Etiemble
Hello,

I personnally barley use MonoDevelop as it is pretty unstable. If you
want to use Monobjc within a MonoDevelop project, the simplest way is
to include the assemblies directly in the project. It is dirty, but it
works.

If you go with the "pc" file, you should take a look at the existing ones.

Regards, Laurent Etiemble.

2009/4/17 Brian Barnt :
> All-
>   I new to development on OS X.  How do I install the  monobjc package into
> MonoDevelop?  From the MonoDevelop FAQ, it looks like I need to create a .pc
> file, but I'm not quite sure what goes into it, or where it goes...
> Brian


Re: [us...@lists.monobjc.net] GdiPlus and X11

2009-04-24 Thread Laurent Etiemble
Hello,

Do you have X11 installed on the Tiger machine ? For historical
reasons, Monobjc.Cocoa.dll depends on System.Drawing, which requires
libgdiplus.dylib. This library has a lot of dependencies and many of
them are found in the X11 installation.

Regards, Laurent Etiemble.

2009/4/16 Franky De Meyer :
> Hi Laurent,
>
> Another quick question ;)
>
> Some of my users, who have OSX Tiger, seem to be getting the error below.
> GdiPlus not getting initialized.
> I did some research and it seems that one may have to install X11 to get
> GdiPlus to work on Tiger.
>
> Do you happen to have any more info on that?
>
> I'm currently asking users to install Mono 2.4, but want to ship the final
> version as a native universal binary.
>
> Thanks,
> Franky
>
> Here is the exception report:
>
> OS version: Version 10.4.11 (Build 8S2167)
>
> System.TypeInitializationException:
> An exception was thrown by the type initializer for System.Drawing.GDIPlus
>  ---> System.DllNotFoundException:
> /Library/Frameworks/Mono.framework/Versions/2.4/lib/libgdiplus.dylib
>
> at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
> (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOut
> put&)
>
> at System.Drawing.GDIPlus..cctor () [0x0]
> --- End of inner exception stack trace ---
>  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x0]
> at System.Drawing.Image.LoadFromStream (System.IO.Stream stream, Boolean
> keepAlive) [0x0]
> at System.Drawing.Image.FromStream (System.IO.Stream stream) [0x0]
>
>


[us...@lists.monobjc.net] Re: Monobjc and System.Drawing

2009-04-24 Thread Laurent Etiemble
Hello,

(Note: Cross posting to the user list)

For historical reasons, NSColor and NSImage were made to be implicitly
usable with the Color and Image classes. It was a quick way to make
existing code works (image loading, various colors, etc). Now, Monobjc
contains everything needed to replace all the code linked to the
colors, images or drawing.

Moreover, it seems that on Tiger, the X11 installation is a
show-stopper. So my question is: "Shall we drop the System.Drawing
dependency ?". This will mean no more Color and Image implicit
conversion, no more access to System.Drawing drawing methods, etc.

Please comment on the list.

Regards, Laurent Etiemble.

2009/4/22 Mac Programmer :
> Is there any particular reason why Monobjc needs to be dependent on
> System.Drawing? Monobjc uses System.Drawing in a few places for converting,
> say, between NSColor and System.Drawing.Color and these uses appear to be
> safe. However, if one uses, say, System.Drawing.SystemColors.ButtonFace,
> this results in the following exception on a computer that does not have
> Mono installed:
>
> Unhandled Exception: System.TypeInitializationException: An exception was
> thrown by the type initializer for System.Drawing.KnownColors --->
> System.TypeInitializationException: An exception was thrown by the type
> initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException:
> /Library/Frameworks/Mono.framework/Versions/2.4/lib/libgdiplus.dylib
>  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
> (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
>  at System.Drawing.GDIPlus..cctor () [0x0]
>  --- End of inner exception stack trace ---
>  at System.Drawing.KnownColors..cctor () [0x0]
>  --- End of inner exception stack trace ---
>  at System.Drawing.SystemColors.get_ButtonFace () [0x0]
>
>
> I would rather not include any assembly in my mkbundle2-generated executable
> that depends on libgdiplus.dylib, which in turn requires that X11 being
> installed, as well as having all the other .dylib's that libgdiplus.dylib
> depends on (libtiff.dylib, libjpeg.dylib, etc.). This is akin to
> late-binding, where you won't know if any given System.Drawing reference
> will work until it's been tested, meaning all possible paths to that code
> needs to be tested.
>
> Thanks.
>
> -Phil
>
>


Re: [us...@lists.monobjc.net] Re: Monobjc and System.Drawing

2009-04-24 Thread Laurent Etiemble
Hello,

What kind of samples are you thinking at ? If you (or somebody else)
give me enough topics (let's say 5), I will be able to set up a
documentation page or a tutorial.

Regards, Laurent Etiemble.

2009/4/24 Ben Martin :
> Hi Laurent,
>
> For my projects, being able to use System.Drawing is the main benefit for
> using monobjc.
>
> A way to help move code could be to provide more samples of converting
> System.Drawing to Cocoa.
>
>
> Ben Martin
>
> -Original Message-
> From: laurent.etiem...@gmail.com [mailto:laurent.etiem...@gmail.com] On
> Behalf Of Laurent Etiemble
> Sent: Friday, 24 April 2009 5:47 PM
> To: Mac Programmer; Monobjc User List
> Subject: [us...@lists.monobjc.net] Re: Monobjc and System.Drawing
>
> Hello,
>
> (Note: Cross posting to the user list)
>
> For historical reasons, NSColor and NSImage were made to be implicitly
> usable with the Color and Image classes. It was a quick way to make
> existing code works (image loading, various colors, etc). Now, Monobjc
> contains everything needed to replace all the code linked to the
> colors, images or drawing.
>
> Moreover, it seems that on Tiger, the X11 installation is a
> show-stopper. So my question is: "Shall we drop the System.Drawing
> dependency ?". This will mean no more Color and Image implicit
> conversion, no more access to System.Drawing drawing methods, etc.
>
> Please comment on the list.
>
> Regards, Laurent Etiemble.
>
> 2009/4/22 Mac Programmer :
>> Is there any particular reason why Monobjc needs to be dependent on
>> System.Drawing? Monobjc uses System.Drawing in a few places for
> converting,
>> say, between NSColor and System.Drawing.Color and these uses appear to be
>> safe. However, if one uses, say, System.Drawing.SystemColors.ButtonFace,
>> this results in the following exception on a computer that does not have
>> Mono installed:
>>
>> Unhandled Exception: System.TypeInitializationException: An exception was
>> thrown by the type initializer for System.Drawing.KnownColors --->
>> System.TypeInitializationException: An exception was thrown by the type
>> initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException:
>> /Library/Frameworks/Mono.framework/Versions/2.4/lib/libgdiplus.dylib
>>  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
>>
> (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOut
> put&)
>>  at System.Drawing.GDIPlus..cctor () [0x0]
>>  --- End of inner exception stack trace ---
>>  at System.Drawing.KnownColors..cctor () [0x0]
>>  --- End of inner exception stack trace ---
>>  at System.Drawing.SystemColors.get_ButtonFace () [0x0]
>>
>>
>> I would rather not include any assembly in my mkbundle2-generated
> executable
>> that depends on libgdiplus.dylib, which in turn requires that X11 being
>> installed, as well as having all the other .dylib's that libgdiplus.dylib
>> depends on (libtiff.dylib, libjpeg.dylib, etc.). This is akin to
>> late-binding, where you won't know if any given System.Drawing reference
>> will work until it's been tested, meaning all possible paths to that code
>> needs to be tested.
>>
>> Thanks.
>>
>> -Phil
>>
>>
>
>


Re: [us...@lists.monobjc.net] Problem building samples

2009-04-25 Thread Laurent Etiemble
Hello,

Does somebody else notices this missing symbolic link ? If yes, which
version of Mono was installed (the precise number of the package) ?

Regards, Laurent Etiemble.

2009/4/24 Ron Grove :
> Works now.  Appears you have to have pkg-config in your path even though the
> Nant user manual pages on their website don't mention anything about that.
>  The Mono installer put links to about everything in my /usr/bin folder but
> not to that one.  I didn't think anything of it since I (mistakenly) assumed
> if you wanted to use nant everything you needed would work since it's
> installed right along with everything else.  Anyhow, that's why running it
> manually worked just fine but running it in build scripts didn't work on
> either of our OS X computers.  Hope this helps anyone else in the future
> that isn't very used to troubleshooting things on a *nix system. :-)
>
> Thank you,
> Ron
>
> On Apr 24, 2009, at 12:24 AM, Franky De Meyer wrote:
>
>> Actually, I ran into the same problem a few weeks ago.
>>
>> It happened after upgrading mono 2.2 to 2.4
>> I had been googling for similar cases a well, and tried similar things
>> like
>> you.
>>
>> I also installed MonoDevelop, which was suggested as a fix by someone, but
>> that didn't solve it for me.
>>
>> At this moment it IS working, and I'm not sure how I got there.
>> These are the things that might have caused it to start working again:
>> - Numerous uninstalls and reinstalls of both mono 2.2 and 2.4
>> - Updated monobjc from 2.0.324 to 2.0.342
>> - made sure I was using the most recent NAnt.monobjc.dll
>> - I also got around to update my Mac with the latest updates: I'm not at
>> the
>> most recent MacOS v10.5.6 Build 9G55
>>
>> It must have been one of these actions or even a combination that has
>> cured
>> this weird behavior of nant
>>
>> Good luck and let us know how it goes. I know it's frustrating.
>


Re: [us...@lists.monobjc.net] Universal binary

2009-04-30 Thread Laurent Etiemble
Hello,

What are these tools ? Do they provide information of what is wrong in
the binary ?

Regards, Laurent Etiemble.

2009/4/30 Mario De Clippeleir :
> Hi,
>
> I use the build script to generate an universal binary (mkbundle). All this
> works fine. The application starts on a clean environment...
> However, when i try to run some third party software on it (for
> analysis/encryption...), it says that there is a problem with the universal
> binary.
> Anybody heard of this ? Solutions ?
>
> Br,
>
> Mario
>


Re: [us...@lists.monobjc.net] RE: [us...@lists.monobjc.net] Re: Monobjc and System.Drawing

2009-05-02 Thread Laurent Etiemble
Hello,

The dependency on System.Drawing is there to allow implicit conversion
between Cocoa types and System.Drawing types. With such conversions,
it is easy to keep existing System.Drawing code (image loading/saving,
image manipulation, drawing, etc) and to cast a Bitmap to a NSImage
when needed for example.

Removing the dependency, means that the implicit conversions will be
no longer available. Therefore, all the image and drawing code must be
migrated to Cocoa counterparts.

I am writing a brief tutorial to explain how to convert System.Drawing
snippets to Cocoa ones, in order to ease the migration.

Regards, Laurent Etiemble.

2009/5/2 Mac Programmer :
> Why would removing Monobjc's dependency on System.Drawing affect your use of
> System.Drawing?
> Thanks.
> -Phil
>
>> For my projects, being able to use System.Drawing is the main benefit for
>> using monobjc.
>


Re: [us...@lists.monobjc.net] PLIST

2009-05-16 Thread Laurent Etiemble
Hello,

The Info.plist can be generated by the  task (see
http://www.monobjc.net/index.php?page=building-tools). The generation uses
the "name", "icon", "identifier" and "version" attribute.

Note that in release 2.0.342 there is a bug in the spelling of the
"identifier" attribute: it is misspelled "indentifier". This will be
corrected in the next release.

Regards, Laurent Etiemble.

2009/5/15 Mario De Clippeleir 

> Hi,
>
> How do i set information in the info.plist file ?
>
> Br,
>
> Mario
>


[us...@lists.monobjc.net] [ANN] Monobjc 2.0.357.0 Released

2009-05-18 Thread Laurent Etiemble
Hello,

I am proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET, etc.) that interact with Objective-C frameworks and libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

In the 2.0.357.0 release:
- Remove the dependency on System.Drawing (no need to install X11
under Mac OS X 10.4)
- Many fixes for Core Animation (CALayer and its subclasses, CATransform3D, etc)
- New interoperabilty methods for NSArray and NSDictionary (Find,
ForEach, strongly typed accessors and enumerators)
- Minor fixes in build tools and in samples.

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples: http://www.monobjc.net/index.php?page=sample-applications
Programming Guide: http://www.monobjc.net/index.php?page=programming-guide

Feedback, remarks and donations are welcomed !!!

Regards, Laurent Etiemble.


Re: [us...@lists.monobjc.net] [ANN] Monobjc 2.0.357.0 Released

2009-05-27 Thread Laurent Etiemble
Hello,

I am still writing the tutorial (not much time for now). Meanwhile,
you can find some useful code in the SimpleDrawing sample application
(creating/drawing/resizing images, drawing shapes/text, etc...).

Regards, Laurent Etiemble.

2009/5/26 Ben Martin :
> Hi Laurent,
>
> Any update on the tutorials for porting System.Drawing code to Cocoa?
>
> Ben Martin
>
>
> -Original Message-
> From: laurent.etiem...@gmail.com [mailto:laurent.etiem...@gmail.com] On
> Behalf Of Laurent Etiemble
> Sent: Tuesday, 19 May 2009 6:33 AM
> To: Monobjc User List; Monobjc Devel List; mono-...@lists.ximian.com
> Subject: [us...@lists.monobjc.net] [ANN] Monobjc 2.0.357.0 Released
>
> Hello,
>
> I am proud to announce that a new release of Monobjc bridge is
> available (http://www.monobjc.net/). The Monobjc bridge provides the
> necessary tools to develop and run .NET applications (written in C#,
> VB.NET, etc.) that interact with Objective-C frameworks and libraries
> under Mac OS X. Existing Objective-C classes can be used in .NET code
> in an almost transparent manner.
>
> In the 2.0.357.0 release:
> - Remove the dependency on System.Drawing (no need to install X11
> under Mac OS X 10.4)
> - Many fixes for Core Animation (CALayer and its subclasses, CATransform3D,
> etc)
> - New interoperabilty methods for NSArray and NSDictionary (Find,
> ForEach, strongly typed accessors and enumerators)
> - Minor fixes in build tools and in samples.
>
> Downloads: http://www.monobjc.net/index.php?page=downloads
> Tutorials : http://www.monobjc.net/index.php?page=tutorials
> Samples: http://www.monobjc.net/index.php?page=sample-applications
> Programming Guide: http://www.monobjc.net/index.php?page=programming-guide
>
> Feedback, remarks and donations are welcomed !!!
>
> Regards, Laurent Etiemble.
>
>


Re: [us...@lists.monobjc.net] mkbundle and machine.config problem

2009-05-27 Thread Laurent Etiemble
Hello,

It seems to be a regression in Mono 2.4; I have tried with Mono 2.2
and it works fine.
I will try to take a look to find out why the bundled machine config
is not used even if it is properly bundled.

Regards, Laurent Etiemble.

2009/5/27 Steven Lammens :
> Hi,
>
> I have been playing around with the monobjc mkbundle nant task to
> distribute an application which makes use of .NET web requests and I
> am having trouble including the machine.config in the bundle.
>
> Relevant part of the build file:
>
>            todir="${build.dir}"
>         target="MACOSX_10_5"
>         universal="true"
>         
> machine-config="/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config">
>      
>   
>
> Build output:
>  ...
>  [mkbundle] Embedding Assembly
> '/Library/Frameworks/Mono.framework/Versions/2.4/lib/mono/gac/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll'
>  [mkbundle] Embedding Config
> '/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config'
>  [mkbundle] Relocating Config
> '/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config'
>  [mkbundle] Source generation done in 19.93 seconds
>  [mkbundle] Compiling native sources...
>  ...
>
> When running the application on a Mac without Mono the following
> exception is thrown when performing a web request:
>
> Unhandled Exception: System.NotSupportedException:
> http://www.slammens.com/monobjc/test.html
>   at System.Net.WebRequest.GetCreator (System.String prefix) [0x0]
>   at System.Net.WebRequest.Create (System.Uri requestUri) [0x0]
>   at System.Net.WebRequest.Create (System.String requestUriString) [0x0]
>   at Monobjc.Samples.HelloCocoa.HelloController.ShowMessage
> (Monobjc.Id sender) [0x0]
>   at 
> Monobjc.Dynamic.Proxies.Monobjc.Samples.HelloCocoa.HelloController.ShowMessage_Monobjc_Id
> (IntPtr receiver, IntPtr selector, IntPtr ) [0x0]
>   at (wrapper native-to-managed)
> Monobjc.Dynamic.Proxies.Monobjc.Samples.HelloCocoa.HelloController:ShowMessage_Monobjc_Id
> (intptr,intptr,intptr)
>   at (wrapper managed-to-native) 503C41BB:pinvoke (intptr,intptr)
>   at 503C41BB.objc_msgSend (IntPtr receiver, IntPtr selector,
> System.Object[] parameters) [0x0]
>   at Monobjc.Bridge.Generators.DynamicMessagingGenerator.SendMessage
> (System.String message, IntPtr receiver, IntPtr selector,
> System.Object[] parameters) [0x0]
>   at Monobjc.ObjectiveCRuntime.SendMessage (IManagedWrapper receiver,
> System.String selector, System.Object[] parameters) [0x0]
>   at Monobjc.Cocoa.NSApplication.Run () [0x0]
>   at Monobjc.Cocoa.NSApplication.RunApplication () [0x0]
>   at Monobjc.Samples.HelloCocoa.Program.Main (System.String[] args) [0x0]
>
> I have modified the HelloCocoa sample from monobjc to perform a web
> request when clicking the "Show Message" button. It can be downloaded
> from: http://www.slammens.com/monobjc/HelloCocoaWebRequest.zip.
>
> What am I doing wrong here?
>
> OSX Leopard 10.5.7
> Mono 2.4
> Monobjc 2.0.357.0
>
> Regards,
>
> Steven Lammens
>


Re: [us...@lists.monobjc.net] mkbundle and machine.config problem

2009-05-27 Thread Laurent Etiemble
Hello,

There is bug report for this issue in the Mono's tracker:
https://bugzilla.novell.com/show_bug.cgi?id=495957

Regards, Laurent Etiemble.

2009/5/27 Steven Lammens :
> Hi,
>
> I have been playing around with the monobjc mkbundle nant task to
> distribute an application which makes use of .NET web requests and I
> am having trouble including the machine.config in the bundle.
>
> Relevant part of the build file:
>
>            todir="${build.dir}"
>         target="MACOSX_10_5"
>         universal="true"
>         
> machine-config="/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config">
>      
>   
>
> Build output:
>  ...
>  [mkbundle] Embedding Assembly
> '/Library/Frameworks/Mono.framework/Versions/2.4/lib/mono/gac/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll'
>  [mkbundle] Embedding Config
> '/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config'
>  [mkbundle] Relocating Config
> '/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/2.0/machine.config'
>  [mkbundle] Source generation done in 19.93 seconds
>  [mkbundle] Compiling native sources...
>  ...
>
> When running the application on a Mac without Mono the following
> exception is thrown when performing a web request:
>
> Unhandled Exception: System.NotSupportedException:
> http://www.slammens.com/monobjc/test.html
>   at System.Net.WebRequest.GetCreator (System.String prefix) [0x0]
>   at System.Net.WebRequest.Create (System.Uri requestUri) [0x0]
>   at System.Net.WebRequest.Create (System.String requestUriString) [0x0]
>   at Monobjc.Samples.HelloCocoa.HelloController.ShowMessage
> (Monobjc.Id sender) [0x0]
>   at 
> Monobjc.Dynamic.Proxies.Monobjc.Samples.HelloCocoa.HelloController.ShowMessage_Monobjc_Id
> (IntPtr receiver, IntPtr selector, IntPtr ) [0x0]
>   at (wrapper native-to-managed)
> Monobjc.Dynamic.Proxies.Monobjc.Samples.HelloCocoa.HelloController:ShowMessage_Monobjc_Id
> (intptr,intptr,intptr)
>   at (wrapper managed-to-native) 503C41BB:pinvoke (intptr,intptr)
>   at 503C41BB.objc_msgSend (IntPtr receiver, IntPtr selector,
> System.Object[] parameters) [0x0]
>   at Monobjc.Bridge.Generators.DynamicMessagingGenerator.SendMessage
> (System.String message, IntPtr receiver, IntPtr selector,
> System.Object[] parameters) [0x0]
>   at Monobjc.ObjectiveCRuntime.SendMessage (IManagedWrapper receiver,
> System.String selector, System.Object[] parameters) [0x0]
>   at Monobjc.Cocoa.NSApplication.Run () [0x0]
>   at Monobjc.Cocoa.NSApplication.RunApplication () [0x0]
>   at Monobjc.Samples.HelloCocoa.Program.Main (System.String[] args) [0x0]
>
> I have modified the HelloCocoa sample from monobjc to perform a web
> request when clicking the "Show Message" button. It can be downloaded
> from: http://www.slammens.com/monobjc/HelloCocoaWebRequest.zip.
>
> What am I doing wrong here?
>
> OSX Leopard 10.5.7
> Mono 2.4
> Monobjc 2.0.357.0
>
> Regards,
>
> Steven Lammens
>


Re: [us...@lists.monobjc.net] System.IndexOutOfRangeException: Array index is out of range.

2009-05-31 Thread Laurent Etiemble
Hello,

Can you be a bit more specific ? Please provide:
- The context
- The offending source code
- If it is a general behavior or a local one
- anything that might help to find out the origin

Regards, Laurent Etiemble.

2009/5/28 yoni shalom :
> System.IndexOutOfRangeException: Array index is out of range.
>
> at System.Collections.Generic.Dictionary`2.set_Item (intptr,Monobjc.Id)
> <0x001cf>
>
> at Monobjc.ObjectiveCRuntime.MapInstance (intptr,Monobjc.Id) <0x000af>
>
> at Monobjc.Id.set_NativePointer (intptr) <0x00075>
>
> at Monobjc.Id..ctor (intptr) <0x0001d>
>
> at Monobjc.Cocoa.NSObject..ctor (intptr) <0x00013>
>
> at (wrapper dynamic-method) Monobjc.Cocoa.NSObject.CreateInstance (intptr)
> <0x00024>
>
> at Creator`1.CreateInstance (intptr) <0x00016>
>
> at Monobjc.ObjectiveCRuntime.GetInstance (intptr,bool) <0x0034f>
>
> at Monobjc.ObjectiveCRuntime.GetInstance (intptr) <0x00012>
>
> at Monobjc.Dynamic.Proxies.Monobjc.Cocoa.NSObject.Dealloc (intptr,intptr)
> <0x00013>
>
> at (wrapper native-to-managed)
> Monobjc.Dynamic.Proxies.Monobjc.Cocoa.NSObject.Dealloc (intptr,intptr)
> <0x00029>
>
>
> 1. Why does a Dealloc code path lead to CreateInstance ?
> 2. Huh ?
> 3. What ?
> 4. etc.
> Thanks.


Re: [us...@lists.monobjc.net] Program no longer starts up after first run

2009-06-13 Thread Laurent Etiemble
Hello,

Very strange indeed. Can you get one of your user to do the following:
- execute 'ls -Rl' when the application is installed.
- execute 'ls -Rl' when the application has been launched for the first time.

The result may give some hints on what is going wrong.

Regards, Laurent Etiemble.

2009/6/12 Franky De Meyer :
> Anybody run against this phenomena? :
>
> A number of users are reporting that our monobjc program no longer starts up
> after running for the first time.
> They download the software, put it on their Desktop or in their Applications
> folder, run it and all works fine. Then when they want to try it a second or
> third or nth time, the program doesn't startup anymore. Strangely enough,
> re-downloading the software seems to fix it ... until the next time they run
> into this.
>
> One user sent following console report:
> "imac24-5 com.apple.launchd[136] ([0x0-0x5c05c].DM[605]):
> posix_spawnp("/Applications/DM.app", ...): Permission denied"
>
> So it looks like a permission problem, but the users claim to have all
> rights on their system. I'm also doing a CHMOD 777 on all files in the .app
> package before publishing.
>
> I'm publishing the soft as a monobjc application bundle with nant (no native
> binary). Then I'm compressing as a zip and post on the web.
>
> Any ideas on this would be welcome, thanks!
>
> Franky
>
>


Re: [us...@lists.monobjc.net] [Fwd: Memory issues and crash]

2009-07-02 Thread Laurent Etiemble
Hello,

(Note: I haven't run your code, so my analysis is purely based on the
code reading.)

I think you should avoid releasing objects inside notification
callbacks, as you may release object that triggers the notification,
or object that handles the notification (that why a crash occurs). You
should find another design to to what you want.

Regards, Laurent Etiemble.

2009/6/23 Kenny Clement :
> Hi,
>
> I've been having some issues with memory management with a Monobjc project.
> I don't whether I'm doing something wrong here (most likely) , or if
> it's a Monobjc bug.
>
> In my project, and this sample application, I have a NIB with the File's
> owner set to my custom class.
> I have an NSWindow, which the File's owner as it's delegate.
> When the window closes, I Release() the custom class (File's owner).
>
> Problem #1) This all works fine. Until I want to use a NIB outlet in my
> code.
> As soon as I add an [NSObjectiveCField], it crashes when the class deallocs.
> Crash log can be found below.
>
> Problem #2) I needed some Cocoa binding. I bind to another custom class
> which just contains a property.
> The class is used (class set in the NIB file), but I can see that it never
> gets dealloc'd. Do I need
> to Release() it manually? (even though I never alloc'd myself?). I expect it
> to
> dealloc at least when the application exits.
>
> ===
>
> I've written a small sample app to show the problems.
> In the attached sample, Monobjc 1.0 binaries have been used, because I
> need Tiger compatibility.
> Use the 'nant clean build' command to create an app in the dist folder.
>
> You'll see that the sample works perfectly, no crashes.
> If you check the logging however, you'll notice problem #2: Dealloc is
> never called on the viewmodel
>
> To see problem #1: in MainWindow.cs, uncomment line 12: //[ObjectiveCField].
> Rebuild.
> Open the app, close the window, or quit the App: Crash!
>
> Crashlog:
>
> Deallocating form: MainWindow
> Cleanup
> Stacktrace:
>
>   at (wrapper managed-to-native)
> Monobjc.SafeNativeMethods.object_setInstanceVariable
> (intptr,string,intptr)<0x4>
>   at (wrapper managed-to-native)
> Monobjc.SafeNativeMethods.object_setInstanceVariable
> (intptr,string,intptr)<0x>
>   at Monobjc.Dynamic.Proxies.BindingExample.MainWindow.ExportMembers
> (BindingExample.MainWindow)<0x00033>
>   at
> Monobjc.Dynamic.Proxies.BindingExample.MainWindow.windowWillClose_Monobjc_Cocoa_NSNotification
> (intptr,intptr,intptr)<0x0005b>
>   at (wrapper native-to-managed)
> Monobjc.Dynamic.Proxies.BindingExample.MainWindow.windowWillClose_Monobjc_Cocoa_NSNotification
> (intptr,intptr,intptr)<0x>
>   at (wrapper managed-to-native) 4FBC41BB.pinvoke (intptr,intptr)<0x4>
>   at (wrapper managed-to-native) 4FBC41BB.pinvoke (intptr,intptr)
> <0x>
>   at 4FBC41BB.objc_msgSend (intptr,intptr,object[])<0x00013>
>   at Monobjc.Bridge.Generators.DynamicMessagingGenerator.SendMessage
> (string,intptr,intptr,object[])<0x000ea>
>   at Monobjc.ObjectiveCRuntime.SendMessage
> (Monobjc.IManagedWrapper,string,object[])<0x00071>
>   at Monobjc.Cocoa.NSApplication.Run ()<0x0002a>
>   at Monobjc.Cocoa.NSApplication.RunApplication ()<0x0001c>
>   at BindingExample.Program.Main ()<0x00039>
> Abort trap
>
>
>
> I hope you can help,
>
> Thanks in advance!
>
>
> Kenny Clement
>
>
>


Re: [us...@lists.monobjc.net] bug in NSUserDefaults

2009-07-09 Thread Laurent Etiemble
Hello,

Thanks for spotting it. It will be fixed in the next release (by
mid-july if everything goes well).

Regards, Laurent Etiemble.

2009/7/9 Cameron Villers :
> It looks like NSUserDefaults.Synchronize is translated wrong. In Objective-C
> the definition is:
>
> - (BOOL)synchronize
>
> However, in Monobjc we get:
>
> public virtual bool Synchronize
> {
>    get { return ObjectiveCRuntime.SendMessage(this, "synchronize"); }
> }
>
> though synchronize is actually a method and not a property.
>


[us...@lists.monobjc.net] [ANN] Monobjc 2.0.404.0 Released

2009-07-15 Thread Laurent Etiemble
Hello,

I am proud to announce that a new release of Monobjc bridge is
available (http://www.monobjc.net/). The Monobjc bridge provides the
necessary tools to develop and run .NET applications (written in C#,
VB.NET, etc.) that interact with Objective-C frameworks and libraries
under Mac OS X. Existing Objective-C classes can be used in .NET code
in an almost transparent manner.

In the 2.0.404.0 release:
- Many fixes in signatures to get the right type
- More flexibility when processing a XIB/NIB file into code
- Minor fixes in build tools and in samples.

Downloads: http://www.monobjc.net/index.php?page=downloads
Tutorials : http://www.monobjc.net/index.php?page=tutorials
Samples: http://www.monobjc.net/index.php?page=sample-applications
Programming Guide: http://www.monobjc.net/index.php?page=programming-guide

Feedback, remarks and donations are welcomed !!!

Regards, Laurent Etiemble.


Re: [us...@lists.monobjc.net] NullReferenceException can't be caught anymore

2009-08-14 Thread Laurent Etiemble
Hello,

The signal handling was primarly added to help catching message
passing to deallocated instance. While this has demonstrated good
results in most situation, I have found another way to spot these kind
of problems.

So, in the next release, I will make the signal handling optional, so
the old behavior will be restored, while keeping the possibility to
handle signal exceptions.

Regards, Laurent Etiemble.

2009/8/5 Bastien Hofmann :
> Hello,
>
> In Monobjc 2.0.404.0, it doesn't seem possible to catch
> NullReferenceException anymore, instead a SIGBUS signal is intercepted, the
> application is stopped with an error message.
>
> I assume this has something to do with the signal handling added in
> 2.0.388.0, however because of this, now instead of having a full callstack
> which points me to my null reference, I get an error message and a small
> unrelated callstack that doesn't help me find the source of the error.
>
> Is there a way to restore the previous behavior, or prevent Monobjc from
> catching this signal?
>
> Thanks in advance,
> Best regards,
> Bastien Hofmann
>
>


Re: [us...@lists.monobjc.net] Monobjc is breaking AppDomain.CreateDomain?

2009-08-14 Thread Laurent Etiemble
Hello,

Can you indicate the version of Mono and Monobjc ? Also, can you post
a small sample code to demonstrate the problem ?

Regards, Laurent Etiemble.

2009/8/13 Kenny Clement :
> Hi,
>
> I have a problem.
> I've noticed that when you use
>
> AppDomain.CreateDomain("name");
>
> and somewhere in your app, there is a reference to the MonobjC assembly, it
> throws an exception.
> In other words, it's not possible to create a second AppDomain.
> Is there any way to get around this?
> In the second AppDomain, I don't even need Monobjc...
>
> The exception can be found below.
>
> Thanks,
>
> - Kenny
>
>
> Exception:
> TypeInitializationException
> An exception was thrown by the type initializer for
> System.Runtime.Serialization.Formatters.Binary.CodeGenerator
>  at
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata
> (System.Type type) [0x0]
>  at
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData
> (System.Object obj,
> System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata,
> System.Object& data) [0x0]
>  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
> (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x0]
>  at
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
> (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject)
> [0x0]
>  at
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
> (System.IO.BinaryWriter writer) [0x0]
>  at
> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
> (System.IO.BinaryWriter writer, System.Object obj,
> System.Runtime.Remoting.Messaging.Header[] headers) [0x0]
>  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
> (System.IO.Stream serializationStream, System.Object graph,
> System.Runtime.Remoting.Messaging.Header[] headers) [0x0]
>  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
> (System.IO.Stream serializationStream, System.Object graph) [0x0]
>  at System.Runtime.Remoting.Channels.CADSerializer.SerializeObject
> (System.Object obj) [0x0]
>  at System.Runtime.Remoting.Messaging.CADMethodCallMessage..ctor
> (IMethodCallMessage callMsg) [0x0]
>  at System.Runtime.Remoting.Messaging.CADMethodCallMessage.Create (IMessage
> callMsg) [0x0]
>  at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage
> (IMessage msgRequest) [0x0]
>
> InnerException: NotSupportedException
> The invoked member is not supported in a dynamic module.
>  at System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () [0x0]
>  at Monobjc.ObjectiveCRuntime.ScanAssembly (System.Reflection.Assembly
> assembly) [0x0]
>  at Monobjc.ObjectiveCRuntime.CurrentDomain_AssemblyLoad (System.Object
> sender, System.AssemblyLoadEventArgs args) [0x0]
>  at System.AppDomain.DoAssemblyLoad (System.Reflection.Assembly assembly)
> [0x0]
>  at (wrapper managed-to-native)
> System.Reflection.Emit.AssemblyBuilder:basic_init
> (System.Reflection.Emit.AssemblyBuilder)
>  at System.Reflection.Emit.AssemblyBuilder..ctor
> (System.Reflection.AssemblyName n, System.String directory,
> AssemblyBuilderAccess access, Boolean corlib_internal) [0x0]
>  at System.AppDomain.DefineInternalDynamicAssembly
> (System.Reflection.AssemblyName name, AssemblyBuilderAccess access)
> [0x0]
>  at (wrapper remoting-invoke-with-check)
> System.AppDomain:DefineInternalDynamicAssembly
> (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
>  at System.Runtime.Serialization.Formatters.Binary.CodeGenerator..cctor ()
> [0x0]
>
>


Re: [us...@lists.monobjc.net] Tooltips in NSMatrix

2009-08-18 Thread Laurent Etiemble
Hello,

Have you tried NSMatrix.SetToolTipForCell ?
(http://api.monobjc.net/html/M_Monobjc_Cocoa_NSMatrix_SetToolTipForCell_2_3d28d9a9.htm)

Regards, Laurent Etiemble.

2009/8/18 Mario De Clippeleir :
> Hi,
>
> how do you implement tooltips in Cells in a NSMatrix ? The cells are being
> built programmatically...
>
> Thanks,
>
> Mario
>


Re: [us...@lists.monobjc.net] Re: Monobjc is breaking AppDomain.CreateDomain?

2009-08-23 Thread Laurent Etiemble
Hello,

Can you try using the latest release of Monobjc (2.0.404) ? A related
issue has been fixed in this release (see bug#000180
http://tracker.monobjc.net/view.php?id=180).

Regards, Laurent Etiemble.

2009/8/17 Kenny Clement :
> Hi,
>
> Monobjc version: 1.0.324.0. I'm using the 1.0 assemblies, because I need
> Tiger support.
> Haven't tried in the new version of Monobjc yet.
>
> mono -V:
> Mono JIT compiler version 2.4 (tarball Fri Mar 13 09:25:35 MDT 2009)
>
> It's reproducable in any Monobjc app with 1 single line:
>
> AppDomain.CreateDomain("name");
>
> I've put this line in the SimpleCocoaApp Sample
> SimpleCocoaApp/HelloController.cs
> Just put this line in the awakeFromNib function and the app will crash at
> startup.
>
> Regards,
>
>
> Kenny Clement
>
>
> Laurent Etiemble wrote:
>>
>> Hello,
>>
>> Can you indicate the version of Mono and Monobjc ? Also, can you post
>> a small sample code to demonstrate the problem ?
>>
>> Regards, Laurent Etiemble.
>>
>> 2009/8/13 Kenny Clement:
>>
>>>
>>> Hi,
>>>
>>> I have a problem.
>>> I've noticed that when you use
>>>
>>> AppDomain.CreateDomain("name");
>>>
>>> and somewhere in your app, there is a reference to the MonobjC assembly,
>>> it
>>> throws an exception.
>>> In other words, it's not possible to create a second AppDomain.
>>> Is there any way to get around this?
>>> In the second AppDomain, I don't even need Monobjc...
>>>
>>> The exception can be found below.
>>>
>>> Thanks,
>>>
>>> - Kenny
>>>
>>>
>>> Exception:
>>> TypeInitializationException
>>> An exception was thrown by the type initializer for
>>> System.Runtime.Serialization.Formatters.Binary.CodeGenerator
>>>  at
>>>
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata
>>> (System.Type type) [0x0]
>>>  at
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData
>>> (System.Object obj,
>>> System.Runtime.Serialization.Formatters.Binary.TypeMetadata&  metadata,
>>> System.Object&  data) [0x0]
>>>  at
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
>>> (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x0]
>>>  at
>>>
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
>>> (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject)
>>> [0x0]
>>>  at
>>>
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
>>> (System.IO.BinaryWriter writer) [0x0]
>>>  at
>>>
>>> System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
>>> (System.IO.BinaryWriter writer, System.Object obj,
>>> System.Runtime.Remoting.Messaging.Header[] headers) [0x0]
>>>  at
>>> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
>>> (System.IO.Stream serializationStream, System.Object graph,
>>> System.Runtime.Remoting.Messaging.Header[] headers) [0x0]
>>>  at
>>> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
>>> (System.IO.Stream serializationStream, System.Object graph) [0x0]
>>>  at System.Runtime.Remoting.Channels.CADSerializer.SerializeObject
>>> (System.Object obj) [0x0]
>>>  at System.Runtime.Remoting.Messaging.CADMethodCallMessage..ctor
>>> (IMethodCallMessage callMsg) [0x0]
>>>  at System.Runtime.Remoting.Messaging.CADMethodCallMessage.Create
>>> (IMessage
>>> callMsg) [0x0]
>>>  at
>>> System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage
>>> (IMessage msgRequest) [0x0]
>>>
>>> InnerException: NotSupportedException
>>> The invoked member is not supported in a dynamic module.
>>>  at System.Reflection.Emit.AssemblyBuilder.GetExportedTypes () [0x0]
>>>  at Monobjc.ObjectiveCRuntime.ScanAssembly (System.Reflection.Assembly
>>> assembly) [0x0]
>>>  at Monobjc.ObjectiveCRuntime.CurrentDomain_AssemblyLoad (System.Object
>>> sender, System.AssemblyLoadEventArgs args) [0x0]
>>>  at System.AppDomain.DoAssemblyLoad (System.Reflection.Assembly assembly)
>>> [0x0]
>>>  at (wrapper managed-to-native)
>>> System.Reflection.Emit.AssemblyBuilder:basic_init
>>> (System.Reflection.Emit.AssemblyBuilder)
>>>  at System.Reflection.Emit.AssemblyBuilder..ctor
>>> (System.Reflection.AssemblyName n, System.String directory,
>>> AssemblyBuilderAccess access, Boolean corlib_internal) [0x0]
>>>  at System.AppDomain.DefineInternalDynamicAssembly
>>> (System.Reflection.AssemblyName name, AssemblyBuilderAccess access)
>>> [0x0]
>>>  at (wrapper remoting-invoke-with-check)
>>> System.AppDomain:DefineInternalDynamicAssembly
>>>
>>> (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
>>>  at System.Runtime.Serialization.Formatters.Binary.CodeGenerator..cctor
>>> ()
>>> [0x0]
>>>
>>>
>>>
>


  1   2   3   >