mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-23 19:31:10 +00:00
make example compilable
svn path=/trunk/gtk-sharp/; revision=17597
This commit is contained in:
parent
82f46a92a0
commit
3de09c2018
|
@ -11,6 +11,23 @@
|
|||
<remarks>
|
||||
<example>
|
||||
<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.TextBuffer buffer;
|
||||
|
@ -19,6 +36,18 @@
|
|||
buffer = view.Buffer;
|
||||
|
||||
buffer.Text = "Hello, this is some text";
|
||||
|
||||
win.Add (view);
|
||||
win.ShowAll ();
|
||||
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
void OnWinDelete (object obj, DeleteEventArgs args)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
</code>
|
||||
<para>
|
||||
Now you might put the view in a container and display it on
|
||||
|
|
Loading…
Reference in a new issue