[Gtk-sharp-list] help compiling program

Darwin Reynoso monouser at gmail.com
Thu Feb 25 11:05:23 EST 2010


can someone please show me how to compile this. I'm running ubuntu
9.10 and i try gmcs -pkg:gtk-sharp-2.0 sourceview.cs


using Gtk;
using GtkSourceView;

public class SourceViewExample
	public static void Main ()
		// Initialize GTK.
		Application.Init ();
		// Create a containing window.
		Window window = new Window ("SourceView Example");
		window.DeleteEvent += OnDelete;
		window.SetDefaultSize (400, 300);
		// Create the language manager.
		SourceLanguagesManager manager = new SourceLanguagesManager ();
		// Get the C# source language definition.
		SourceLanguage language = manager.GetLanguageFromMimeType ("text/x-csharp");
		// Create a buffer for the language and enable highlighting.
		SourceBuffer buffer = new SourceBuffer (language);
		buffer.Highlight = true;
		// Create a view for the buffer.
		SourceView view = new SourceView (buffer);
		// Create a scrolled window and add the view.
		ScrolledWindow scrolled_window = new ScrolledWindow ();
		scrolled_window.Add (view);
		// Add the scrolled window to the window and show it.
		window.Add (scrolled_window);
		window.ShowAll ();
		// Run the application.
		Application.Run ();
	// Quit when the window is closed.
	static void OnDelete (object o, DeleteEventArgs e)
		Application.Quit ();

More information about the Gtk-sharp-list mailing list