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

Erik Renes keenriser at planet.nl
Wed Jan 9 03:41:05 EST 2008


A non-text attachment was scrubbed...
Name: test.cs
Type: application/octet-stream
Size: 189 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20080109/a4c9f62f/attachment.obj 
-------------- next part --------------


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


More information about the Mono-winforms-list mailing list