[Mono-list] I think I've found a bug. Can anyone confirm or clarify?

Stifu stifu at free.fr
Wed Oct 28 05:46:44 EDT 2009


Something immediately strikes me as wrong: you're mixing GTK# and
Windows.Forms. In your earlier message, I thought this was a WinForms app.
You need to pick one or the other. :)

However, note that Mono / MonoDevelop doesn't have a WinForms designer. So,
if you want to use a GUI designer, either use WinForms on Visual Studio /
SharpDevelop (your exe will still work with Mono), or use GTK# on
MonoDevelop (note that GTK# apps will require an extra 8MB installation to
run on Windows).

Good luck!


CajunCoder wrote:
> 
> Hello Everyone,
> 
> Last night, I posted a thread about a problem I was having with
> Application.Exit(). Now, after working with it a bit more, I'm starting to
> wonder if it's actually a bug. So I'm going to ask if anyone can confirm
> this behavior as a bug or clarify if I am misunderstanding something.
> 
> Here are the details:
> 
> When I create a new Gtk# application, it creates the skeleton application
> for me complete with a MainWindows.cs file that contains basic skeleton
> code. In that code, there is the following method:
> 
> protected void OnDeleteEvent (object sender, DeleteEventArgs a)
> 	{
> 		Application.Quit();
> 		a.RetVal = true;
> 	}
> 
> Now, this code handles closing the form when the "X" is clicked at the
> top, if I remember correctly. Now, that works fine even though,
> technically the Quit() method isn't part of the Application object. It
> just works. I don't know why. Add to that I can use Application.Quit()
> anywhere else in the application and it immediately will quit the
> application.
> 
> Now, I add a reference to System.Windows.Forms and the corresponding
> 'using System.Windows.Forms;' statement and it all breaks!  Suddenly, the
> compiler starts to complain that 'The name Application doesn't exist in
> the current context' and it catches all of my Application.Quit()
> statements.
> 
> So, I change these to Application.Exit() (the correct .NET statement) and
> THAT fails too. In fact, the ONLY thing that works is if I use the full
> System.Windows.Forms.Application.Exit(). However, if I add that statement
> to the OnDeleteEvent() method, nothing happens.
> 
> The bottom line is I cannot quit my application and I can find no way
> around it. This seems like a bug for a few reasons:
> 
> 1. Application.Quit() works until I add the System.Windows.Forms
> reference.
> 2. Application.Exit() doesn't work unless the entire path is specified,
> without fail.
> 
> Is this indeed a bug or am I missing something vital here?
> 
> Thanks in Advance. I'm really trying to understand Mono as I come from a
> Visual Studio background but I'm having absolutely no luck with this
> issue.
> 
> Thank You,
> Anthony Papillion
> 

-- 
View this message in context: http://www.nabble.com/I-think-I%27ve-found-a-bug.-Can-anyone-confirm-or-clarify--tp26090516p26091877.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list