Created
September 15, 2011 05:16
-
-
Save mythz/1218600 to your computer and use it in GitHub Desktop.
Basic F# demo using Mono Gtk#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let btnUp = new Button("Increment", Visible=true) | |
let btnDown = new Button("Decrement", Visible=true) | |
let lbl = new Label(Text=" Count: 0", Visible=true) | |
Event.merge | |
(btnUp.Clicked |> Event.map (fun _ -> +1)) | |
(btnDown.Clicked |> Event.map (fun _ -> -1)) | |
|> Event.scan (+) 0 | |
|> Event.map (sprintf " Count: %d") | |
|> Event.add (fun s -> lbl.Text <- s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment