From: Stefano Zacchiroli Date: Fri, 30 Jan 2004 08:14:19 +0000 (+0000) Subject: added string_of_html_msg X-Git-Tag: V_0_2_3~119 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=a17df4da923600a12126dfd2d15fd201119fd334;p=helm.git added string_of_html_msg --- diff --git a/helm/ocaml/logger/ui_logger.ml b/helm/ocaml/logger/ui_logger.ml index a711f5d38..5be084efc 100644 --- a/helm/ocaml/logger/ui_logger.ml +++ b/helm/ocaml/logger/ui_logger.ml @@ -11,6 +11,16 @@ type html_tag = type html_msg = [ `Error of html_tag | `Msg of html_tag ] +let string_of_html_msg = + let rec string_of_html_tag = function + | `T s -> s + | `L msgs -> String.concat "" (List.map string_of_html_tag msgs) + | `BR -> "\n" + in + function + | `Error tag -> "Error: " ^ string_of_html_tag tag + | `Msg tag -> string_of_html_tag tag + class html_logger ?width ?height ?packing ?show () = let scrolled_window = GBin.scrolled_window ?packing ?show () in let vadj = scrolled_window#vadjustment in diff --git a/helm/ocaml/logger/ui_logger.mli b/helm/ocaml/logger/ui_logger.mli index 3c548550f..c66a22635 100644 --- a/helm/ocaml/logger/ui_logger.mli +++ b/helm/ocaml/logger/ui_logger.mli @@ -2,6 +2,8 @@ type html_tag = [ `BR | `L of html_tag list | `T of string ] type html_msg = [ `Error of html_tag | `Msg of html_tag ] +val string_of_html_msg: html_msg -> string + class html_logger: ?width:int -> ?height:int -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit ->