mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-06-18 13:00:14 +00:00
Update dample
svn path=/trunk/gtk-sharp/; revision=36749
This commit is contained in:
parent
0c81f9142c
commit
6eea226ab7
|
@ -1,7 +1,7 @@
|
||||||
|
// mcs -pkg:gtkhtml-sharp -pkg:gtk-sharp gtk-html-sample.cs
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using GtkSharp;
|
|
||||||
using System;
|
using System;
|
||||||
// mcs -r gtkhtml-sharp -r gtk-sharp gtk-html-sample.cs
|
using System.IO;
|
||||||
|
|
||||||
class HTMLSample {
|
class HTMLSample {
|
||||||
static int Main (string [] args)
|
static int Main (string [] args)
|
||||||
|
@ -13,8 +13,15 @@ class HTMLSample {
|
||||||
win = new Window ("Test");
|
win = new Window ("Test");
|
||||||
win.Add (html);
|
win.Add (html);
|
||||||
HTMLStream s = html.Begin ("text/html");
|
HTMLStream s = html.Begin ("text/html");
|
||||||
s.Write ("<html><body>");
|
|
||||||
s.Write ("Hello world!");
|
if (args.Length > 0){
|
||||||
|
StreamReader r = new StreamReader (File.OpenRead (args [0]));
|
||||||
|
s.Write (r.ReadToEnd ());
|
||||||
|
} else {
|
||||||
|
s.Write ("<html><body>");
|
||||||
|
s.Write ("Hello world!");
|
||||||
|
}
|
||||||
|
|
||||||
html.End (s, HTMLStreamStatus.Ok);
|
html.End (s, HTMLStreamStatus.Ok);
|
||||||
win.ShowAll ();
|
win.ShowAll ();
|
||||||
Application.Run ();
|
Application.Run ();
|
||||||
|
|
Loading…
Reference in a new issue