[Mono-winforms-list] swf

Peter Dennis Bartok peter@novonyx.com
Sat, 30 Oct 2004 13:14:40 -0600


I know very little about X11 on the Mac, but someone told me that you had to 
explicitly start the X server if you wanted to run X11 stuff.
Any chance you didn't do that (yet)?

Peter

-----Original Message-----
From: "gennady wexler" <adyler@winisp.net>
To: "Peter Dennis Bartok" <peter@novonyx.com>; "Paul" 
<paul@all-the-johnsons.co.uk>; "mono-winforms" 
<mono-winforms-list@lists.ximian.com>
Date: Saturday, 30 October, 2004 09:42
Subject: Re: [Mono-winforms-list] swf


>yes I am on the mac. :) mac os x 10.3, darwin 7.5, gcc 3.3 to be exact. the
>standard package.
>
>thanks for fixing the removing of .so from libraries names. it now declares
>this error, which is expected?..
>
>Unhandled Exception: System.TypeInitializationException: An exception was
>thrown by the type initializer for System.Windows.Forms.XplatUI --->
>System.DllNotFoundException: libX11
>in <0x000d8> (wrapper managed-to-native)
>System.Windows.Forms.XplatUIX11:XOpenDisplay (intptr)
>in <0x000c0> System.Windows.Forms.XplatUIX11:.ctor ()
>in <0x0006c> System.Windows.Forms.XplatUIX11:GetInstance ()
>in <0x0004c> System.Windows.Forms.XplatUI:.cctor ()
>--- End of inner exception stack trace -
>
>adding mapping to translate libX11 to libX11.dylib appears to bypass this
>particular error (which proves mono does not default to .dylib - not sure
>whats the best treat here), however nothing gets displayed - no windows.
>
>source for Form1 is in mcs/class/System.Windows.Forms/Samples, I trimmed it
>to exclude controls which SWF does not know about it.
>
>should it at least show a window?
>
>all I get is this:
>
>apple:~/mono/cvs/mcs/class/System.Windows.Forms/Samples adyler$ mono
>Form1.exe
>#region #line XplatUI Constructor called
>
>
>On 10/30/04 3:30 AM, "Peter Dennis Bartok" <peter@novonyx.com> wrote:
>
>> Well, looks like you're on a Mac. I seem to remember that there was an 
>> issue
>> with having mono default to .dylib for shared libs, but I could be wrong 
>> and
>> confusing this with something else. Either way, I just removed the .so
>> ending from the DllImports in CVS, that shouldn't have been there. That
>> should help the automatic mapping mechanism. Also, if that doesn't work 
>> you
>> can try to manually map the dl through the config file.
>>
>> Peter
>>
>> -----Original Message-----
>> From: "gennady wexler" <adyler@winisp.net>
>> To: "Peter Dennis Bartok" <peter@novonyx.com>; "Paul"
>> <paul@all-the-johnsons.co.uk>; "mono-winforms"
>> <mono-winforms-list@lists.ximian.com>
>> Date: Friday, 29 October, 2004 22:58
>> Subject: Re: [Mono-winforms-list] swf
>>
>>
>>> you are sure the problem is with whether X is running or not? we cant 
>>> seem
>>> to find this dll at all. I get exact same call stack from under X term
>>> session. any idea where this dll lives and why it is not there?
>>>
>>> the only things I have in my X11 lib folder are these. are we missing
>>> mapping? where does the mapping suppose to be defined for this to work?
>>>
>>> lrwxr-xr-x   1 root  wheel       15 21 Aug 00:34 libSM.dylib ->
>>> libSM.6.0.dylib
>>> -rw-r--r--   1 root  wheel   995424  2 Mar  2004 libX11.6.2.dylib
>>> lrwxr-xr-x   1 root  wheel       16 21 Aug 00:34 libX11.6.dylib ->
>>> libX11.6.2.dylib
>>> -rw-r--r--   1 root  wheel  1572168  2 Mar  2004 libX11.a
>>> lrwxr-xr-x   1 root  wheel       16 21 Aug 00:34 libX11.dylib ->
>>> libX11.6.2.dylib
>>> -rw-r--r--   1 root  admin     9972  2 Mar  2004 libXRes.1.0.dylib
>>> lrwxr-xr-x   1 root  wheel       17 21 Aug 00:34 libXRes.1.dylib ->
>>> libXRes.1.0.dylib
>>> -rw-r--r--   1 root  wheel     5072  2 Mar  2004 libXRes.a
>>> lrwxr-xr-x   1 root  wheel       17 21 Aug 00:34 libXRes.dylib ->
>>> libXRes.1.0.dylib
>>> -rw-r--r--   1 root  wheel    33132  2 Mar  2004 libXTrap.6.4.dylib
>>> lrwxr-xr-x   1 root  wheel       18 21 Aug 00:34 libXTrap.6.dylib ->
>>> libXTrap.6.4.dylib
>>> -rw-r--r--   1 root  wheel    39804  2 Mar  2004 libXTrap.a
>>> lrwxr-xr-x   1 root  wheel       18 21 Aug 00:34 libXTrap.dylib ->
>>> libXTrap.6.4.dylib
>>> -rw-r--r--   1 root  wheel    13844  2 Mar  2004 libXau.a
>>>
>>>
>>> apple:~/mono/cvs/mcs/class/System.Windows.Forms/Samples adyler$
>>> mono --debug
>>> Form1.exe
>>>
>>> Unhandled Exception: System.TypeInitializationException: An exception 
>>> was
>>> thrown by the type initializer for System.Windows.Forms.XplatUI --->
>>> System.DllNotFoundException: libX11.so
>>> in <0x000d8> (wrapper managed-to-native)
>>> System.Windows.Forms.XplatUIX11:XOpenDisplay (intptr)
>>> in [0x00032] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> XplatUIX11.cs:138) System.Windows.Forms.XplatUIX11:.ctor ()
>>> in [0x0001b] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> XplatUIX11.cs:172) System.Windows.Forms.XplatUIX11:GetInstance ()
>>> in [0x0001e] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> XplatUI.cs:183) System.Windows.Forms.XplatUI:.cctor ()
>>> --- End of inner exception stack trace ---
>>>
>>> in (unmanaged) System.Windows.Forms.XplatUI:get_DefaultClassName ()
>>> in [0x00043] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Control.cs:1776) System.Windows.Forms.Control:get_CreateParams ()
>>> in [0x00043] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Control.cs:1776) System.Windows.Forms.Control:get_CreateParams ()
>>> in [0x00001] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Form.cs:184) FormParentWindow:get_CreateParams ()
>>> in [0x00087] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Control.cs:757) System.Windows.Forms.Control:.ctor ()
>>> in [0x00001] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Form.cs:158) FormParentWindow:.ctor (System.Windows.Forms.Form)
>>> in <0x00094> (wrapper remoting-invoke-with-check) FormParentWindow:.ctor
>>> (System.Windows.Forms.Form)
>>> in [0x00013] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Form.cs:498) System.Windows.Forms.Form:get_CreateParams ()
>>> in [0x00087] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Control.cs:757) System.Windows.Forms.Control:.ctor ()
>>> in [0x00001] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> ScrollableControl.cs:217) System.Windows.Forms.ScrollableControl:.ctor 
>>> ()
>>> in [0x00001] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> ContainerControl.cs:46) System.Windows.Forms.ContainerControl:.ctor ()
>>> in [0x00001] (at
>>> /Users/adyler/mono/cvs/mcs/class/Managed.Windows.Forms/System.Windows.Forms/
>>> Form.cs:302) System.Windows.Forms.Form:.ctor ()
>>> in <0x00020> WindowsApplication1.Form1:.ctor ()
>>> in <0x0007c> (wrapper remoting-invoke-with-check)
>>> WindowsApplication1.Form1:.ctor ()
>>> in <0x0002c> WindowsApplication1.Form1:Main ()
>>>
>>> apple:~/mono/cvs/mcs/class/System.Windows.Forms/Samples adyler$
>>>
>>>
>>> On 10/27/04 11:20 PM, "Peter Dennis Bartok" <peter@novonyx.com> wrote:
>>>
>>>>> But surely, this isn't a mono problem? If the X server isn't running
>>>>> (say a machine is set to runlevel 3), then the libraries won't be 
>>>>> loaded
>>>>> either. An X session won't be started so the best that can happen is 
>>>>> an
>>>>> exception is thrown. As I've said though, the error report would vary
>>>>> between platforms...
>>>> Well, it's not a Mono problem per se, no, if you want to display via X
>>>> you
>>>> need an X-Server. But, the libs will load just fine even if no X-Server
>>>> is
>>>> run on the machine where they are being loaded. After all, just loading
>>>> they
>>>> won't know if there's an X-Server running or not, and X-servers can be
>>>> remote.
>>>> We're just not handling the fact that we can't open the display, and 
>>>> that
>>>> is
>>>> ultimately a Mono/MWF problem. All we need to do is deal with
>>>> XOpenDisplay
>>>> returning null, instead of just assuming it didn't. At that point we 
>>>> can
>>>> choose to throw an exception or even just display an error message and
>>>> exit
>>>> the app. Simple fix. In fact, so simple, I just fixed it in the head 
>>>> CVS
>>>> version :-)
>>>>
>>>> Cheers,
>>>>   Peter
>>>>
>>>> _______________________________________________
>>>> Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>>
>>>
>>> _______________________________________________
>>> Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>>
>>>
>>
>
>
>
>