[Mono-winforms-list] Windows Forms on Mac OS X

Geoff Norton gnorton at novell.com
Wed Jan 9 10:32:07 EST 2008


Dont use the X11 driver.

export MONO_MWF_USE_QUARTZ_BACKEND=1
export MONO_MWF_USE_CARBON_BACKEND=1

-g

On 9-Jan-08, at 7:34 AM, Erik Renes wrote:

> Hi Everyone,
> A short status update ...
>
> Meanwhile I have succesfully installed cairo using macports, then I  
> have dllmapped the libcairo to the one installed by macports by  
> editing the config file in the Mono.Framework etc/ directory:
> <dllmap dll="libcairo-2.dll" target="/opt/local/lib/libcairo.dylib"  
> os="osx"/>
>
> This caused the windows forms application to work, however, only in  
> the second instance of X11. Let me elaborate:
> First I start my test.exe using 'mono test.exe', then X11 pops up in  
> the dock and does not do anything. If I quit the running X11  
> instance (right click on X in the dock and click Quit) it  
> immediately comes back after closing down. Directly after, the  
> messagebox is being shown as expected.
>
> I can now run Windows Forms apps normally, however if I close this  
> second instance of X11, I have to repeat the procedure to get it  
> working again.
> Now for development this is not so much of an issue, but runtime  
> deployment I don't think any user would want to do this just to run  
> one app.
>
> Does anyone have any suggestions that I can try to make it work as  
> intended? (or is this intended?) I have read something about a  
> native driver for winforms, is it enabled by default in Mono 1.2.6  
> on Mac OS X? If not, maybe this is something for me to try out, if  
> anyone could tell me how to enable it?
>
> Best Regards,
> Erik Renes
>
> On Jan 9, 2008, at 9:41 AM, Erik Renes wrote:
>
>> <test.cs>
>>
>> Hi All,
>>
>> I am currently trying to get a windows forms application to run on  
>> Mac OS X 10.5.1 (clean Mac OS X install, clean Mono install with  
>> the Mac OS X package from the website), however, it seems that  
>> there is something wrong with my setup. I have created a test  
>> application that does nothing but show a messagebox (attached:  
>> test.cs).
>>
>> The moment I do anything with windows forms, my application hangs.
>> I have used the --trace mono option to check where it goes wrong,  
>> the following happens the first time I run the application:
>>
>> . . . . . . . . . . . . . . . . . . . . ENTER:  
>> System.Windows.Forms.XplatUIX11:.ctor ()(this: 
>> 0x1d31050[System.Windows.Forms.XplatUIX11 test.exe], )
>> . . . . . . . . . . . . . . . . . . . . . ENTER:  
>> System.Windows.Forms.XplatUIDriver:.ctor ()(this: 
>> 0x1d31050[System.Windows.Forms.XplatUIX11 test.exe], )
>> . . . . . . . . . . . . . . . . . . . . . LEAVE:  
>> System.Windows.Forms.XplatUIDriver:.ctor ()
>>
>> [ ... lots of initialization ... ]
>> . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper managed- 
>> to-native) System.Windows.Forms.XplatUIX11:XInitThreads ()()
>> . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper managed- 
>> to-native) System.Windows.Forms.XplatUIX11:XInitThreads ()result=1
>> . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper managed- 
>> to-native) System.Windows.Forms.XplatUIX11:XOpenDisplay (intptr) 
>> (0x0, )
>>
>> After the XOpenDisplay, my application does not proceed.
>> Then I try to run it again (the previous application is closed, but  
>> X11 is still running) and get the following hang:
>>
>> ENTER: System.Environment:GetEnvironmentVariable (string)([STRING: 
>> 0x1822aa0:MONO_GDIP_USE_COCOA_BACKEND], )
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: (wrapper managed-to-native)  
>> System.Security.SecurityManager:get_SecurityEnabled ()()
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: (wrapper managed-to-native)  
>> System.Security.SecurityManager:get_SecurityEnabled ()FALSE
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: (wrapper managed-to-native)  
>> System.Environment:internalGetEnvironmentVariable (string)([STRING: 
>> 0x1822aa0:MONO_GDIP_USE_COCOA_BACKEND], )
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: (wrapper managed-to-native)  
>> System.Environment:internalGetEnvironmentVariable (string) 
>> [STRING:null],
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: System.Environment:GetEnvironmentVariable (string) 
>> [STRING:null],
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: System.Environment:get_OSVersion ()()
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: System.Environment:get_OSVersion ()[System.OperatingSystem: 
>> 0x1d2bf00]
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: System.Drawing.GdiplusStartupInput:MakeGdiplusStartupInput () 
>> (VALUERET:0xbfffe1b4, )
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: System.Drawing.GdiplusStartupInput:MakeGdiplusStartupInput () 
>> [01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,]
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: System.Drawing.GdiplusStartupOutput:MakeGdiplusStartupOutput  
>> ()(VALUERET:0xbfffe19c, )
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> LEAVE: System.Drawing.GdiplusStartupOutput:MakeGdiplusStartupOutput  
>> ()[00,00,00,00,00,00,00,00,]
>> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
>> ENTER: (wrapper managed-to-native)  
>> System.Drawing.GDIPlus:GdiplusStartup  
>> (ulong 
>> &,System 
>> .Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&) 
>> ([BYREF:0x8fafa4], [BYREF:0xbfffe1a4], [BYREF:0xbfffe194], )
>>
>> It seems that the initialization of GDIPlus does not complete  
>> succesfully.
>>
>> I have found threads on the OS X list suggesting that I should use  
>> a dll map to tell mono where my X11 is resided, however, this is  
>> already installed by default with the mono OS X package. What I  
>> think might be the problem - I'm not sure - is that I don't have  
>> Cairo installed. If this is indeed a problem, can anyone suggest a  
>> way to install this and make mono aware of it?
>>
>> I would be happy to receive any suggestions on how to troubleshoot  
>> this issue, as I have never used a mac for development before.
>>
>> Best Regards,
>> Erik Renes_______________________________________________
>> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20080109/bd3c5273/attachment.html 


More information about the Mono-winforms-list mailing list