• 下载编译安装
  • 代码
namespace GtkSamples
{

    using Gtk;
    using Gdk;
    using System;

    public class HelloWorld
    {

        public static int Main (string[] args)
        {
            Application.Init ();
            Gtk.Window win   = new Gtk.Window ("Gtk# Hello World");
            win.DeleteEvent += new DeleteEventHandler (Window_Delete);
            win.ShowAll ();
            Application.Run ();
            return 0;
        }

        static void Window_Delete (object obj, DeleteEventArgs args)
        {
            Application.Quit ();
            args.RetVal = true;
        }

    }
}
  • 编译
mcs \
	-r ../atk/atk-sharp   \
	-r ../gtk/gtk-sharp   \
	-r ../gdk/gdk-sharp   \
	-r ../glib/glib-sharp \
	HelloWorld.cs
  • 运行
Logo

更多推荐