Skip to content

Instantly share code, notes, and snippets.

@caiorss
Created March 10, 2017 17:31
Show Gist options
  • Save caiorss/16de470ed00bbd101a956deb136fce6b to your computer and use it in GitHub Desktop.
Save caiorss/16de470ed00bbd101a956deb136fce6b to your computer and use it in GitHub Desktop.
Monoのサンプルコード
using System;
using Gtk;
public partial class MainWindow: Gtk.Window
{
public MainWindow () : base (Gtk.WindowType.Toplevel)
{
Window myWin = new Window ("My first GTK# Application!");
myWin.Resize (200, 200);
Label myLabel = new Label ();
myLabel.Text = "Hello World!!";
myWin.Add (myLabel);
myWin.ShowAll ();
//Build ();
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
}
}
using System;
using Gtk;
namespace gtksharptest1
{
class MainClass
{
public static void Main (string[] args)
{
Application.Init ();
MainWindow win = new MainWindow ();
//win.Show ();
Application.Run ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment