Running and Porting
Mono® System.Windows.Forms Applications

Peter Dennis Bartok

Software Engineer

Novell, Inc.

Jackson Harper

Software Engineer

Novell, Inc.

Overview

What is System.Windows.Forms (SWF)

Where to get Managed Windows Forms (MWF)

Status (current and where)

Installation

Sample Application

What works/what doesn't work

Future plans

Pointers

Q & A

What is SWF

Microsoft .Net API for GUI programming

Provides classes for almost all Win32 controls and functions

MS' implementation mostly wraps native Win32 controls

Mono implementation is completely written in managed code, which is why we refer to the Mono version as Managed Windows Forms

Interfacing with OS is done through 'drivers', managed code P/Invoking native calls

Drivers exist for Win32, Linux and Mac OS X

Theming interface allows to get platform-native look

Where to get MWF

MWF is distributed with Mono since release 1.1.4 and will be one of the main new features of Mono 1.2

Snapshots are in the dailies at www.go-mono.com/daily

Build from SVN. How to can be found at www.mono-project.com/contributing/compiling.html

Status

Aproximiately 95% of the API is implemented

All controls are implemented except DataGrid and RichText

Color, Font, and File Dialogs are complete

Printing support (Dialogs and System.Drawing back end) is still missing

Needs more bug fixing and testing

Class status can always be found at http://mwf.mono-project.com/class-status-System.Windows.Forms.html

Installation

Windows:
Ready to use after install, no special steps required

Linux:
Since X11 is used on Linux, an Xserver and the X libraries must be installed

Mac OS X
Starting with Mono 1.1.4 a native OS X driver is part of MWF. However, X11 is still required due to some font dependencies (freetype). Display will be done natively.

Sample Application

Compiling under MS.Net

csc demo.cs /r:System.Windows.Forms.dll

/r:System.Drawing.dll

Running under MS.Net

Execute 'demo.exe'

Compiling under Mono

mcs demo.cs /r:System.Windows.Forms.dll

/r:System.Drawing.dll

Running under Mono

run 'mono demo.exe'

For MWF applications, make sure DISPLAY is set

Non-Portable Code

The following things won't work with Mono or MWF:

Classes using COM objects, for example Active X controls (AxHost class)

P/Invokes to Win32 system calls (or any other native DLLs)

Example:
[DllImport (“user32.dll”,EntryPoint=”GetSystemMetrics”)]
extern static int GetSystemMetrics(...)

Future Plans

Completion of DataGrid class.

Compatibility improvements (More testcases, ensure MS compatible behavior

Performance enhancements (Drawing, Controls)

Improve TextBox classes and text output (Pango)

Add .Net 2.0 support

Further Information
Mono:

MWF:
mwf.mono-project.com

Mailing list:
mono-winforms-list@ximian.com

Bugs:
bugzilla.ximian.com [Mono Class Libs]

Building Mono & MWF: http://www.all-the-johnsons.co.uk/mono/mono-compiling.html

Latest Pre-Built DLL:

http://mwf.mono-project.com/System.Windows.Forms.dll

Q & A

2003-12-08T12:43:39