X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Flablgtk%2Flablgtk_20000829-0.1.0%2Fexamples%2Fold%2Ffixpoint.ml;fp=helm%2FDEVEL%2Flablgtk%2Flablgtk_20000829-0.1.0%2Fexamples%2Fold%2Ffixpoint.ml;h=0000000000000000000000000000000000000000;hb=c7514aaa249a96c5fdd39b1123fbdb38d92f20b6;hp=c41b11b50b6d9ec4813f7ff92919f1c19b283ac8;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff;p=helm.git diff --git a/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/old/fixpoint.ml b/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/old/fixpoint.ml deleted file mode 100644 index c41b11b50..000000000 --- a/helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/old/fixpoint.ml +++ /dev/null @@ -1,39 +0,0 @@ -(* $Id$ *) - -open GtkData -open GtkBase -open GtkPack -open GtkWindow -open GtkEdit -open GtkMain - -let rec fix fun:f :eq x = - let x' = f x in - if eq x x' then x - else fix fun:f :eq x' - -let eq_float x y = abs_float (x -. y) < 1e-13 - -let _ = - let top = Window.create `TOPLEVEL in - GtkSignal.connect sig:Object.Signals.destroy top callback:Main.quit; - let hbox = Box.create `VERTICAL in - Container.add top hbox; - let entry = Entry.create () in - Entry.set entry max_length:20; - let tips = Tooltips.create () in - Tooltips.set_tip tips entry text:"Initial value for fix-point"; - let result = Entry.create () in - Entry.set result max_length:20 editable:false; - Box.pack hbox entry; - Box.pack hbox result; - - GtkSignal.connect sig:Editable.Signals.activate entry callback: - begin fun () -> - let x = try float_of_string (Entry.get_text entry) with _ -> 0.0 in - Entry.set entry text:(string_of_float (cos x)); - let res = fix fun:cos eq:eq_float x in - Entry.set result text:(string_of_float res) - end; - Widget.show_all top; - Main.main ()