Bug 12852 - Computer hangs-freez completely when position mainwindow
Summary: Computer hangs-freez completely when position mainwindow
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 3.0.x
Hardware: PC Linux
: --- normal
Target Milestone: master
Assignee: Bugzilla
Depends on:
Reported: 2013-06-24 13:36 UTC by Frederik
Modified: 2013-06-27 01:11 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Frederik 2013-06-24 13:36:47 UTC

I don't know where to put this..I'm using MonoDevelop latest stable version on Debian 7.

I did try with manualy code mine mainwindow but it seems that this goes completely wrong.. I know there is a graphical box to set the position of the window But I did want to do it manualy.

The code I did use:
using System;
using System .Collections .Generic ;
using System .Text ;
using Gtk;

public partial class MainWindow: Gtk.Window
	public MainWindow (): base (Gtk.WindowType.Toplevel)
		Build ();
		this.button1 .Label = "Use MessageDialog with 1 button";
		this .button2 .Label = "Use MessageDialog with 2 buttons";
		MainWindow MainWindow =new MainWindow ();
		MainWindow .SetPosition (WindowPosition .CenterAlways );
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
		Application .Quit ();
		a.RetVal = true;

	protected void OnButton1Clicked (object sender, EventArgs e)
		MessageDialog welcome = new MessageDialog (this, DialogFlags .Modal, MessageType.Info, ButtonsType.OkCancel, "The first window you make at Linux with MonoDevelop");
		welcome .Title = "Hello Linux...";
		ResponseType response = (ResponseType)welcome .Run ();
		if (response == ResponseType .Ok) 
			//here we put code when user press OK button
			welcome .Destroy ();	//We want to destroy the message screen welcome
			//Here you can put code when user press Cancel button. 
			System .Media .SystemSounds .Beep .Play ();	//Play system beep sound
			welcome .Destroy ();	//Destroy welcome messagebox

	protected void OnButton2Clicked (object sender, EventArgs e)
		MessageDialog welcome = new MessageDialog (this, DialogFlags .Modal, MessageType.Info, ButtonsType .Ok, "The first window you make at Linux with MonoDevelop");
		welcome .Title = "Hello Linux...";
		welcome .Run ();
		welcome .Destroy ();


The code where it goes wrong:
MainWindow MainWindow =new MainWindow ();
MainWindow .SetPosition (WindowPosition .CenterAlways );

When you try to run this, you have no compiler errors or something like that, but your computer completely FREEZE's..
I think the problem is because I try to use the name MainWindow. The reason why I did try, is because I nowhere can find something to center mine screen, I mean then the MainWindow! I know I can do this graphicaly under the properties from the window,but I want to control it on mine self! 
How we can do this?

Best Regards,

Comment 1 Mike Krüger 2013-06-27 01:11:39 UTC
3.x is outdated - try to build MonoDevelop from master.