[Gtk-sharp-list] help compiling program

Adam Tauno Williams awilliam at whitemice.org
Thu Feb 25 16:45:30 EST 2010


On Thu, 2010-02-25 at 11:05 -0500, Darwin Reynoso wrote:
> Hi,
> 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

When you try that what error do you get?

[Best solution, of course, is to install the fabulous MonoDevelop IDE
and let it do all the grunt work for you.]

> 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 ();
> 	}
> }
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

-- 
openSUSE <http://www.opensuse.org/en/>
Linux for human beings who need to get work done.



More information about the Gtk-sharp-list mailing list