[Mono-winforms-list] Winform Application.Exit() problem
Hi, I've got a hello world app going using Winforms, but I am having a problem getting it to exit cleanly. I have a button with an event attached, that when clicked calls Application.Exit(). The window is destroyed, but the processes keep running, and all I recieve is Disposing window 1E5 (whole: 1E4). I'm sure I'm probably missing something small, but any hints? Scott. -- "The only thing necessary for the triumph of evil is for good men to do nothing" --Edmund Burke ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-winforms-list] Some basic questions on Winforms.
El dt 12 de 04 del 2005 a les 19:25 -0400, en/na Wei Weng va escriure: > > 2: How do I bind a shortcut key to an action/function without using the > setting the shortcut key in MainMenu/ContextMenu? (Can not set menu in my > current mono setup either. Always complains about set_Menu method, throwing > a NullReferenceException) There was a problem that I have just fixed in SVN. You have to compile mono yourself to get the fix or wait to the next release. You can set the shortcut assigned to a MenuItem using the constructor of the object (two accept the shortcut as parameter) or the Shortcut property. Both should work. Jordi, -- Jordi Mas i Hernàndez - Mono development team - http://www.mono-project.com Homepage and LiveJournal at http://www.softcatala.org/~jmas ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-winforms-list] Some basic questions on Winforms.
I'm not directly answering your question, Jordi is working on that, but I wanted to make sure that you are aware that you are using the X11 driver on your mac, due to the way you are starting your application? You cannot run SWF applications via 'mono ', unless you are intentionally trying to use X11 on the Mac. This message (and the whole thread) explains this, and also points out a problem with the 1.1.6 package (unless you're on a G3 you should use 1.1.5 for now, 1.1.6 is missing something, if you're on a G3 use 1.1.6-4). http://lists.ximian.com/archives/public/mono-winforms-list/2005-April/001582.html However, the Mac driver is ALPHA, and does not support menus yet. Cheers, Peter -Original Message- From: "Wei Weng" <[EMAIL PROTECTED]> To: "Jordi Mas" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Date: 13 April, 2005 10:01 Subject: Re: [Mono-winforms-list] Some basic questions on Winforms. >Jordi Mas wrote: >>>2: How do I bind a shortcut key to an action/function without using the >>>setting the shortcut key in MainMenu/ContextMenu? (Can not set menu in my >>>current mono setup either. Always complains about set_Menu method, >>>throwing >>>a NullReferenceException) >> >> >> Hello Wei, >> >> Can you provide a small sample that reproduces this problem? >> >> Thanks! >> > >I have attached the small sample to this email. The environment is mono >1.1.6, OSX 10.3. I could mono the same program on fedora 2, however, the >menu never really showed. > > >The error message I got is: > >[EMAIL PROTECTED] TestMono]$ mono Test.exe >Mono System.Windows.Forms Assembly [Revision: 41731; built: 2005/2/15 >5:56:12] >Keyboard: United States keyboard layout (phantom key version) > >Unhandled Exception: System.NullReferenceException: Object reference not >set to >an instance of an object >in <0x0007c> System.Windows.Forms.Form:set_Menu >(System.Windows.Forms.MainMenu) >in <0x00084> (wrapper remoting-invoke-with-check) >System.Windows.Forms.Form:set_ >Menu (System.Windows.Forms.MainMenu) >in <0x000d8> Form1:InitializeComponent () >in <0x0006c> (wrapper remoting-invoke-with-check) Form1:InitializeComponent >() >in <0x00024> Form1:.ctor () >in <0x00048> (wrapper remoting-invoke-with-check) Form1:.ctor () >in <0x0002c> Form1:Main () > > ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-winforms-list] Some basic questions on Winforms.
Jordi Mas wrote: 2: How do I bind a shortcut key to an action/function without using the setting the shortcut key in MainMenu/ContextMenu? (Can not set menu in my current mono setup either. Always complains about set_Menu method, throwing a NullReferenceException) Hello Wei, Can you provide a small sample that reproduces this problem? Thanks! I have attached the small sample to this email. The environment is mono 1.1.6, OSX 10.3. I could mono the same program on fedora 2, however, the menu never really showed. The error message I got is: [EMAIL PROTECTED] TestMono]$ mono Test.exe Mono System.Windows.Forms Assembly [Revision: 41731; built: 2005/2/15 5:56:12] Keyboard: United States keyboard layout (phantom key version) Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in <0x0007c> System.Windows.Forms.Form:set_Menu (System.Windows.Forms.MainMenu) in <0x00084> (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:set_ Menu (System.Windows.Forms.MainMenu) in <0x000d8> Form1:InitializeComponent () in <0x0006c> (wrapper remoting-invoke-with-check) Form1:InitializeComponent () in <0x00024> Form1:.ctor () in <0x00048> (wrapper remoting-invoke-with-check) Form1:.ctor () in <0x0002c> Form1:Main () using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; public class Form1 : System.Windows.Forms.Form { private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } private void InitializeComponent() { MainMenu mBar = new MainMenu(); MenuItem item1 = new MenuItem(); item1.Text = "File"; mBar.MenuItems.Add(item1); this.Menu = mBar; this.SuspendLayout(); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.ClientSize = new System.Drawing.Size(316, 214); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); } static void Main() { Application.Run(new Form1()); } }
Re: [Mono-winforms-list] Some basic questions on Winforms.
> 2: How do I bind a shortcut key to an action/function without using the > setting the shortcut key in MainMenu/ContextMenu? (Can not set menu in my > current mono setup either. Always complains about set_Menu method, throwing > a NullReferenceException) Hello Wei, Can you provide a small sample that reproduces this problem? Thanks! -- Jordi Mas i Hernàndez - Mono development team - http://www.mono-project.com Homepage and LiveJournal at http://www.softcatala.org/~jmas ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list