GtkSharp/sample/gtk-html-sample.cs
Ben Maurer 12b8e718e1 Make the sample have good coding :-)
svn path=/trunk/gtk-sharp/; revision=36750
2004-11-29 03:28:27 +00:00

31 lines
601 B
C#

// mcs -pkg:gtkhtml-sharp -pkg:gtk-sharp gtk-html-sample.cs
using Gtk;
using System;
using System.IO;
class HTMLSample {
static int Main (string [] args)
{
HTML html;
Window win;
Application.Init ();
html = new HTML ();
win = new Window ("Test");
win.Add (html);
HTMLStream s = html.Begin ("text/html");
if (args.Length > 0) {
using (StreamReader r = File.OpenText (args [0]))
s.Write (r.ReadToEnd ());
} else {
s.Write ("<html><body>");
s.Write ("Hello world!");
}
html.End (s, HTMLStreamStatus.Ok);
win.ShowAll ();
Application.Run ();
return 0;
}
}