make example compilable

svn path=/trunk/gtk-sharp/; revision=17597
This commit is contained in:
John Luke 2003-08-25 20:24:52 +00:00
parent 82f46a92a0
commit 3de09c2018

View file

@ -11,6 +11,23 @@
<remarks> <remarks>
<example> <example>
<code lang="C#"> <code lang="C#">
using System;
using Gtk;
using GtkSharp;
class TextViewSample
{
static void Main ()
{
new TextViewSample ();
}
TextViewSample ()
{
Application.Init ();
Window win = new Window ("TextViewSample");
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
win.SetDefaultSize (600,400);
Gtk.TextView view; Gtk.TextView view;
Gtk.TextBuffer buffer; Gtk.TextBuffer buffer;
@ -19,6 +36,18 @@
buffer = view.Buffer; buffer = view.Buffer;
buffer.Text = "Hello, this is some text"; buffer.Text = "Hello, this is some text";
win.Add (view);
win.ShowAll ();
Application.Run ();
}
void OnWinDelete (object obj, DeleteEventArgs args)
{
Application.Quit ();
}
}
</code> </code>
<para> <para>
Now you might put the view in a container and display it on Now you might put the view in a container and display it on