From 22a7ffd6835f8e36f53bfe07248bd6a0fb582a4f Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 9 Jun 2005 21:12:20 +0000 Subject: [PATCH] added source_view ?text constructor parameter --- helm/DEVEL/lablgtksourceview/gSourceView.ml | 8 ++++++-- helm/DEVEL/lablgtksourceview/gSourceView.mli | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 -- 2.39.2