mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +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 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)
|
||||
|
||||
let quit() =
|
||||
@@ -20,8 +20,8 @@ let quit() =
|
||||
Application.Top.Running <- false
|
||||
|
||||
let buildMenu() =
|
||||
new MenuBar ([|
|
||||
new MenuBarItem (ustr ("File"),
|
||||
MenuBar ([|
|
||||
MenuBarItem (ustr ("File"),
|
||||
[| MenuItem(ustr("_New"), "Creates a new file", System.Action newFile);
|
||||
MenuItem(ustr("_Quit"), null, System.Action quit)
|
||||
|])|])
|
||||
@@ -30,7 +30,7 @@ let buildMenu() =
|
||||
let main argv =
|
||||
Application.Init ()
|
||||
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 (win)
|
||||
Application.Run ()
|
||||
|
||||
Reference in New Issue
Block a user