From: Stefano Zacchiroli Date: Thu, 9 Jun 2005 21:12:20 +0000 (+0000) Subject: added source_view ?text constructor parameter X-Git-Tag: PRE_STORAGE~89 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=22a7ffd6835f8e36f53bfe07248bd6a0fb582a4f;p=helm.git added source_view ?text constructor parameter --- diff --git a/helm/DEVEL/lablgtksourceview/gSourceView.ml b/helm/DEVEL/lablgtksourceview/gSourceView.ml index ec449377b..30f13b2fe 100644 --- a/helm/DEVEL/lablgtksourceview/gSourceView.ml +++ b/helm/DEVEL/lablgtksourceview/gSourceView.ml @@ -72,9 +72,13 @@ object (self) SourceBuffer.end_not_undoable_action obj end -let source_buffer = +let source_buffer ?text = SourceBuffer.make_params [] ~cont:(fun pl () -> - new source_buffer (SourceBuffer.create pl)) + let buf = new source_buffer (SourceBuffer.create pl) in + (match text with + | None -> () + | Some text -> buf#set_text text); + buf) (* alias used below, needed because "source_buffer" is a name in scope *) let source_buffer' = source_buffer diff --git a/helm/DEVEL/lablgtksourceview/gSourceView.mli b/helm/DEVEL/lablgtksourceview/gSourceView.mli index e7bc27638..a041f28a8 100644 --- a/helm/DEVEL/lablgtksourceview/gSourceView.mli +++ b/helm/DEVEL/lablgtksourceview/gSourceView.mli @@ -98,12 +98,12 @@ class source_buffer: end val source_buffer : + ?text:string -> ?check_brackets:bool -> ?escape_char:int -> ?highlight:bool -> ?max_undo_levels:int -> -(* ?tag_table:GText.tag_table -> - ?text:string -> *) +(* ?tag_table:GText.tag_table -> *) unit -> source_buffer