diff --git a/Ooui.Wasm/README.md b/Ooui.Wasm/README.md index f2518cf..d9af42a 100644 --- a/Ooui.Wasm/README.md +++ b/Ooui.Wasm/README.md @@ -13,7 +13,7 @@ Expand that into this directory. ## Build ```bash -csc /nostdlib /target:library /r:managed/mscorlib.dll /r:managed/Ooui.dll /out:managed/Ooui.Sample.dll ooui-sample.cs +csc /nostdlib /target:library /r:managed/mscorlib.dll /r:managed/System.Runtime.dll /r:managed/Ooui.dll /out:managed/Ooui.Sample.dll ooui-sample.cs ``` diff --git a/Ooui.Wasm/ooui-sample.cs b/Ooui.Wasm/ooui-sample.cs index a080e86..d53d6ad 100644 --- a/Ooui.Wasm/ooui-sample.cs +++ b/Ooui.Wasm/ooui-sample.cs @@ -1,12 +1,17 @@ using System; using Ooui; -public class Math { - public static string Add (string a, string b) { +public class Program +{ + public static string Main (string a0, string a1) + { try { - Console.WriteLine ("ENTER"); - var e = new Div (); - return e.Id; + var l = new Label { Text = "Hello" }; + var b = new Button ("Click Me"); + var e = new Div (new Div (l), b); + + UI.SetGlobalElement ("main", e); + return e.ToString (); } catch (Exception e) { Console.WriteLine (e); diff --git a/Ooui.Wasm/ooui-sample.html b/Ooui.Wasm/ooui-sample.html index 9062d34..3588989 100644 --- a/Ooui.Wasm/ooui-sample.html +++ b/Ooui.Wasm/ooui-sample.html @@ -1,14 +1,16 @@ - - -
- - - C# output: -Loading...
+ +