All pastes #886337 Raw Edit

Unnamed

public text v1 · immutable
#886337 ·published 2008-01-31 16:34 UTC
rendered paste body
using Gtk;
using System;
 
class Foo {
 
	static void Main() {

		Application.Init ();
		
		/*
			Create and setup widgets
		*/

		//Hbox
		HBox MainBox = new HBox (false, 4);
	
		//Button
		Button DisplayTextBtn = new Button ("Hello World");
		DisplayTextBtn.Clicked += new EventHandler(DisplayEntryText);
		MainBox.PackStart (DisplayTextBtn);

		//Entry
		Entry TextEntry = new Entry ();
		MainBox.PackStart (TextEntry);
	
		/*
			Create and setup window
		*/

		//Window
		Window win = new Window ("Detta är sparta!");
		win.Add (MainBox);
		win.DeleteEvent += delete_event;

		/*
			Prepare and start application
		*/

		win.ShowAll ();
		Application.Run ();
	}

	static void delete_event (object obj, DeleteEventArgs args) {
	    Application.Quit ();
	}
	 
	static void DisplayEntryText (object obj, EventArgs args) {
		Console.WriteLine("You wrote: "+parent.TextEntry.Text); //FIXME here is the problem...
		//Application.Quit ();
	}
}