summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/examples_camltk/helloworld.ml
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/labltk/examples_camltk/helloworld.ml')
-rw-r--r--otherlibs/labltk/examples_camltk/helloworld.ml47
1 files changed, 30 insertions, 17 deletions
diff --git a/otherlibs/labltk/examples_camltk/helloworld.ml b/otherlibs/labltk/examples_camltk/helloworld.ml
index 9829fca84..c90d7bd6e 100644
--- a/otherlibs/labltk/examples_camltk/helloworld.ml
+++ b/otherlibs/labltk/examples_camltk/helloworld.ml
@@ -13,25 +13,38 @@
(* described in file LICENSE found in the OCaml source tree. *)
(* *)
(***********************************************************************)
-open Camltk;; (* Make interface functions available *)
-let top = opentk ();; (* Initialisation of the interface *)
-(* top is now the toplevel widget *)
+(* Make interface functions available *)
+open Camltk;;
+
+(* Initialisation of the interface. *)
+let top = opentk ();;
+(* top is now the toplevel widget. *)
(* Widget initialisation *)
-let b = Button.create top
- [Text "foobar";
- Command (function () ->
- print_string "foobar";
- print_newline();
- flush stdout)];;
-(* b exists but is not yet visible *)
+let b =
+ Button.create top [
+ Text "foobar";
+ Command
+ (function () ->
+ print_string "foobar";
+ print_newline ();
+ flush stdout);
+ ]
+;;
+(* Now button [b] exists but is not yet visible. *)
+
+let q =
+ Button.create top [
+ Text "quit";
+ Command closeTk;
+ ]
+;;
+(* Button [q] also exists but is not yet visible. *)
-let q = Button.create top
- [Text "quit";
- Command closeTk];;
-(* q exists but is not yet visible *)
+(* Make b and q visible. *)
+pack [b; q] [];;
-pack [b; q][] ;; (* Make b visible *)
-mainLoop() ;; (* User interaction*)
-(* You can quit this program by deleting its main window *)
+(* Start user interaction. *)
+mainLoop ();;
+(* You can also quit this program by deleting its main window. *)