Skip to content

Instantly share code, notes, and snippets.

@mythz
Created September 15, 2011 05:16
Show Gist options
  • Save mythz/1218600 to your computer and use it in GitHub Desktop.
Save mythz/1218600 to your computer and use it in GitHub Desktop.
Basic F# demo using Mono Gtk#
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