mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fix FSharp example compilation (#184)
This commit is contained in:
committed by
Miguel de Icaza
parent
e96f1e70ed
commit
6723f8f870
@@ -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 ok = Button (ustr "Ok", true, Clicked=stop)
|
||||||
let cancel = new Button (ustr "Cancel", Clicked=stop)
|
let cancel = Button (ustr "Cancel", Clicked=stop)
|
||||||
let d = new Dialog (ustr ("New File"), 50, 20, ok, cancel)
|
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 ([|
|
MenuBar ([|
|
||||||
new MenuBarItem (ustr ("File"),
|
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 ()
|
||||||
|
|||||||
Reference in New Issue
Block a user