OnLoad of Form
[mono.git] / mcs / class / System.Windows.Forms / README
1 System.Windows.Forms README
2
3         by John Sohn (jsohn@columbus.rr.com) and Miguel de Icaza (miguel@ximian.com)
4
5         The maintainers:
6                 Dennis Hayes (DENNISH@Raytek.com)
7                 Backup: Miguel de Icaza (miguel@ximian.com)
8
9         Mailing list:
10         
11                 http://lists.ximian.com/mailman/listinfo/mono-winforms-list
12
13                 The address is:
14
15                 mono-winforms-list@ximian.com.
16
17
18 * Introduction
19
20         Welcome to the System.Windows.Forms implementation for Mono.
21         
22         This is still an early version of the class library.  The
23         plans for this library have changed, the plans to use multiple
24         backends is no longer being pursued.
25         
26         We are now implementing this using the Wine library (because
27         Windows.Forms applications require the message handling to be
28         compatible with Windows, look up the Control.Wndproc method
29         for details).
30         
31         Currently it is possible to use the Visual Studio solution in
32         this directory to build the class libraries, and test the
33         sample programs against our implementation.
34         
35         To run and execute with the Mono runtime on linux, the story
36         is more complicated as we need to use the "WineLib" support in
37         Wine.
38
39 * The Layout
40
41         The layout in this directory has some historical files that you can
42         safely ignore, the following are just historical directories:
43
44                 Gtk/
45                 WINElib/
46
47         All of the real code is being done in the same was as it is being done
48         in the rest of the Mono assemblies.
49
50 * Building System.Windows.Forms for Unix using Wine.
51
52         Since a WineLib application is a Windows application that is compiled under 
53         Unix/Linux as a shared library it needs to be started differently than other
54         applications. The WineLib application is started as any other Windows
55         application running under Wine using the wine command. You cannot simply link 
56         in libwine (gcc myapp.c -lwine) to use Win32 functions.
57         
58         In order to use WineLib/Win32 functions under Mono I have created a small
59         "stub" application that embeds the Mono engine inside the WineLib application.
60         This is basically a replacement for the "mono" command that can be used
61         to call the Win32 API (using WineLib) within an application written for Mono.
62         
63         To get started I suggest installing Wine and Mono first if they are not
64         already installed. I am usually using the latest Wine snapshots built from 
65         source and installed under /usr/local. Also be sure to build/use a version of 
66         Mono with garbage collection disabled as there is a problem using WineLib with 
67         garbage collection enabled (check the mono-list archives for this discussion). 
68         You can disable garbage collection when building mono by adding --with-gc=none 
69         to the configure command. In the mono directory I build mono as:
70              ./configure --with-gc=none
71         
72         In the WINELib makefile you may have set these to the appropriate files and/or
73         paths on your PC: 
74         
75         X11R6_INCLUDE=/usr/X11R6/include
76         WINE_INCLUDE=/usr/local/include/wine
77         WINE_LIB=/usr/local/lib/wine
78         
79         If you type make from the mcs/class/System.Windows.Forms/WINELib
80         directory it should build: 
81         
82         System.Windows.Forms.dll - 
83         The current (if largely incomplete) Windows Forms package. 
84         
85         FormTest.exe, NativeWindowTest.exe, Test.exe - 
86         Test applications which link to and tests the System.Windows.Forms.dll 
87         
88         monostub.exe.so - 
89         The WineLib application that starts the Mono/WineLib application. This
90         small WineLib application embeds the Mono JIT engine allowing any Mono
91         application running in it access to WineLib/Win32 function calls. 
92         
93         Before starting any of the applications set the LD_LIBRARY_PATH to the
94         directory where the Wine libraries are located:
95                 export LD_LIBRARY_PATH=/usr/local/lib/wine
96
97         (In this example user32.dll.so can be found in /usr/local/lib/wine)
98
99         To start any of the applications you type (from the WINELib directory): 
100                 wine monostub.exe.so mono-winelibapp.exe 
101         
102         You may also need to add some DLL mappings to the Mono config file (usually
103         in etc/mono/config) if applications are unable to find the Wine libraries.
104
105         Here are the DLL's in the current implementation (more are probably needed):
106
107                 <configuration>
108                         <dllmap dll="user32.dll" target="user32.dll.so" />
109                         <dllmap dll="kernel32.dll" target="kernel32.dll.so" />
110                         <dllmap dll="gdi32.dll" target="gdi32.dll.so" />
111                         <dllmap dll="shell32.dll" target="shell32.dll.so" />
112                         <dllmap dll="comctl32.dll" target="comctl32.dll.so" />
113                 </configuration>
114
115
116