[Mono-osx] Runtime error with Mono 1.1.9

Gareth Baker g.j.baker at dl.ac.uk
Mon Sep 12 05:39:12 EDT 2005


I am getting a runtime error when running some macpacked SWF/mono 1.1.9
programmes. Simpler programmes seem ok (opening window and drawing to simple
canvas), but adding textbaxes or menues causes the failure.

The error is the same from a native OSX (10.4) macpacked programme and the
same programme compiled and run under X11.

The console output:

===== Sunday, September 11, 2005 10:16:53 PM Europe/London =====
Mono System.Windows.Forms Assembly [Revision: 44786; built: 2005/5/25
22:34:45]
mono[285]: Welcome to the WSX:Carbon

Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object
in <0x00000> <unknown method>
in (wrapper managed-to-native)
System.Windows.Forms.XplatUIOSX:GetFontMetrics (intptr,intptr,int&,int&)
in <0x00060> System.Windows.Forms.XplatUIOSX:GetFontMetrics
(System.Drawing.Graphics g, System.Drawing.Font font, System.Int32 ascent,
System.Int32 descent)
in <0x00058> System.Windows.Forms.XplatUI:GetFontMetrics
(System.Drawing.Graphics g, System.Drawing.Font font, System.Int32 ascent,
System.Int32 descent)
in <0x00434> System.Windows.Forms.Line:RecalculateLine
(System.Drawing.Graphics g, System.Windows.Forms.Document doc)
in <0x000fc> System.Windows.Forms.Document:RecalculateDocument
(System.Drawing.Graphics g, Int32 start, Int32 end, Boolean optimize)
in <0x0002c> System.Windows.Forms.Document:RecalculateDocument
(System.Drawing.Graphics g)
in <0x00038> System.Windows.Forms.TextBoxBase:CalculateDocument ()
in <0x00388> System.Windows.Forms.TextBoxBase:set_Text (System.String value)
in <0x0001c> System.Windows.Forms.TextBox:set_Text (System.String value)
in <0x0033c> MyFormProject.MainForm:InitializeComponent ()
in <0x0001c> MyFormProject.MainForm:.ctor ()
in (wrapper remoting-invoke-with-check) MyFormProject.MainForm:.ctor ()
in <0x00030> MyFormProject.MainForm:Main (System.String[] args)
Sep 11 22:17:04 Gareth-Bakers-Computer crashdump[286]: mono crashed
Sep 11 22:17:05 Gareth-Bakers-Computer crashdump[286]: crash report written
to: /Users/garethba/Library/Logs/CrashReporter/mono.crash.log

The programme and the makefile are attached.

Any help would be appreciated.
Regards
Gareth Baker


-------------- next part --------------
// project created on 24/01/2004 at 10:18
using System;
using System.Windows.Forms;

namespace MyFormProject 
{
	class MainForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Button convertButton;
		private System.Windows.Forms.Button quitButton;
		private System.Windows.Forms.Label fahrenheitText;
		private System.Windows.Forms.TextBox celsiusTextBox;
		private System.Windows.Forms.Label label3;
		public MainForm()
		{
			InitializeComponent();
		}
	
		// THIS METHOD IS MAINTAINED BY THE FORM DESIGNER
		// DO NOT EDIT IT MANUALLY! YOUR CHANGES ARE LIKELY TO BE LOST
		void InitializeComponent() {
			this.label3 = new System.Windows.Forms.Label();
			this.celsiusTextBox = new System.Windows.Forms.TextBox();
			this.fahrenheitText = new System.Windows.Forms.Label();
			this.quitButton = new System.Windows.Forms.Button();
			this.convertButton = new System.Windows.Forms.Button();
			this.label2 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(128, 40);
			this.label3.Name = "label3";
			this.label3.TabIndex = 3;
			this.label3.Text = "Celsius";
			// 
			// celsiusTextBox
			// 
			this.celsiusTextBox.Location = new System.Drawing.Point(8, 8);
			this.celsiusTextBox.Name = "celsiusTextBox";
			this.celsiusTextBox.TabIndex = 0;
			this.celsiusTextBox.Text = "32";
			this.celsiusTextBox.Size = new System.Drawing.Size(80,16);			
			// 
			// fahrenheitText
			// 
			this.fahrenheitText.Location = new System.Drawing.Point(8, 40);
			this.fahrenheitText.Name = "fahrenheitText";
			this.fahrenheitText.TabIndex = 1;
			this.fahrenheitText.Text = "0.0";
			// 
			// quitButton
			// 
			this.quitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.quitButton.Location = new System.Drawing.Point(176, 80);
			this.quitButton.Name = "quitButton";
			this.quitButton.TabIndex = 5;
			this.quitButton.Text = "Quit";
			this.quitButton.Click += new System.EventHandler(this.QuitButtonClick);
			// 
			// convertButton
			// 
			this.convertButton.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.convertButton.Location = new System.Drawing.Point(72, 80);
			this.convertButton.Name = "convertButton";
			this.convertButton.TabIndex = 4;
			this.convertButton.Text = "Convert";
			this.convertButton.Click += new System.EventHandler(this.ConvertButtonClick);
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(128, 8);
			this.label2.Name = "label2";
			this.label2.TabIndex = 2;
			this.label2.Text = "Fahrenheit";
			// 
			// MainForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 126);
			this.Controls.Add(this.quitButton);
			this.Controls.Add(this.convertButton);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.fahrenheitText);
			this.Controls.Add(this.celsiusTextBox);
			this.Name = "MainForm";
			this.Text = "Converter";
			this.ResumeLayout(false);
		}
			
		[STAThread]
		public static void Main(string[] args)
		{
			Application.Run(new MainForm());
		}
		
		void ConvertButtonClick(object sender, System.EventArgs e)
		{
			// get the celsiusTextField value
			// and convert to Fahrenheit
			// put it in the label
			double celsiusTemp = Convert.ToDouble(celsiusTextBox.Text.ToString());
			double fahrenheitTemp = (celsiusTemp - 32.0) * 5.00 / 9.0;
			
			fahrenheitText.Text = fahrenheitTemp.ToString("F");
		}
		
		void QuitButtonClick(object sender, System.EventArgs e)
		{
			Application.Exit();
		}
		
	}			
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 335 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20050912/b18b9724/Makefile.obj


More information about the Mono-osx mailing list