]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/lablgtksourceview/gSourceView.ml
added source_view ?text constructor parameter
[helm.git] / helm / DEVEL / lablgtksourceview / gSourceView.ml
index ec449377bffe141c676cc839d2184030110b8438..30f13b2fea3a7942d335d5af0c8b680b309204f0 100644 (file)
@@ -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