mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-23 19:51:08 +00:00
make example compilable
svn path=/trunk/gtk-sharp/; revision=17597
This commit is contained in:
parent
82f46a92a0
commit
3de09c2018
|
@ -11,14 +11,43 @@
|
||||||
<remarks>
|
<remarks>
|
||||||
<example>
|
<example>
|
||||||
<code lang="C#">
|
<code lang="C#">
|
||||||
|
using System;
|
||||||
|
using Gtk;
|
||||||
|
using GtkSharp;
|
||||||
|
|
||||||
Gtk.TextView view;
|
class TextViewSample
|
||||||
Gtk.TextBuffer buffer;
|
{
|
||||||
|
static void Main ()
|
||||||
|
{
|
||||||
|
new TextViewSample ();
|
||||||
|
}
|
||||||
|
|
||||||
view = new Gtk.TextView ();
|
TextViewSample ()
|
||||||
buffer = view.Buffer;
|
{
|
||||||
|
Application.Init ();
|
||||||
|
Window win = new Window ("TextViewSample");
|
||||||
|
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||||
|
win.SetDefaultSize (600,400);
|
||||||
|
|
||||||
|
Gtk.TextView view;
|
||||||
|
Gtk.TextBuffer buffer;
|
||||||
|
|
||||||
buffer.Text = "Hello, this is some text";
|
view = new Gtk.TextView ();
|
||||||
|
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>
|
</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
|
||||||
|
|
Loading…
Reference in a new issue