Advanced Functional Prog.
Graphical User Interfaces (GUI)
As a final, and more sophisticated example, graphical interfaces can be realized with Gtk
framework:
let demo3 _ =
Application.Init ()
let builder = new Builder()
builder.AddFromFile("applications.glade")
let win = new Window(builder.GetObject("window").Handle)
win.DeleteEvent.Add(fun e -> Application.Quit())
let txt = new TextBuffer(builder.GetObject("text").Handle)
let url = new Entry(builder.GetObject("url").Handle)
url.Changed.Add(fun e -> txt.SetText "XXX")
txt.SetText("<html>...</html>")
win.Show()
Application.Run ()
0
demo3 ()
Remarks:
- The design has been realized with the Glade tool.
- The execution requires an additionnal API that can be integrated by adding as a first line:
#r "nuget: GtkSharp, 3.24.24.95"
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp
advanced functional programming programmation fonctionnelle avancée dr mulhouse ensisa france thiry laurent uha fun fsharp