Prechádzať zdrojové kódy

Fix FSharp example compilation (#184)

Sergii Fesenko 6 rokov pred
rodič
commit
6723f8f870
1 zmenil súbory, kde vykonal 6 pridanie a 6 odobranie
  1. 6 6
      FSharpExample/Program.fs

+ 6 - 6
FSharpExample/Program.fs

@@ -10,9 +10,9 @@ let ustr (x:string) = ustring.Make(x)
 let stop = Action Application.RequestStop
 let stop = Action Application.RequestStop
 
 
 let newFile() =
 let newFile() =
-    let ok = new Button (ustr "Ok", true, Clicked=stop)
-    let cancel = new Button (ustr "Cancel", Clicked=stop)
-    let d = new Dialog (ustr ("New File"), 50, 20, ok, cancel)
+    let ok = Button (ustr "Ok", true, Clicked=stop)
+    let cancel = Button (ustr "Cancel", Clicked=stop)
+    let d = Dialog (ustr ("New File"), 50, 20, ok, cancel)
     Application.Run (d)
     Application.Run (d)
 
 
 let quit() =
 let quit() =
@@ -20,8 +20,8 @@ let quit() =
        Application.Top.Running <- false
        Application.Top.Running <- false
 
 
 let buildMenu() =
 let buildMenu() =
-    new MenuBar ([|
-        new MenuBarItem (ustr ("File"), 
+    MenuBar ([|
+        MenuBarItem (ustr ("File"), 
             [| MenuItem(ustr("_New"), "Creates a new file", System.Action newFile);
             [| MenuItem(ustr("_New"), "Creates a new file", System.Action newFile);
                MenuItem(ustr("_Quit"), null, System.Action quit)
                MenuItem(ustr("_Quit"), null, System.Action quit)
              |])|])
              |])|])
@@ -30,7 +30,7 @@ let buildMenu() =
 let main argv =
 let main argv =
     Application.Init ()
     Application.Init ()
     let top = Application.Top
     let top = Application.Top
-    let win = new Window ("Hello"|>ustr, X=Pos.At(0), Y=Pos.At(1), Width=Dim.Fill(), Height=Dim.Fill())
+    let win = Window (ustr "Hello", X=Pos.op_Implicit(0), Y=Pos.op_Implicit(1), Width=Dim.Fill(), Height=Dim.Fill())
     top.Add (buildMenu())
     top.Add (buildMenu())
     top.Add (win)
     top.Add (win)
     Application.Run ()
     Application.Run ()