X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaGui.ml;h=9226ea7b680e78c05eacb771fa179b038a34f52e;hb=275727242ccdce9df01af65f3bfb2d65283fa197;hp=d50a2f31964d5fe50865e9c24e674abf0672488a;hpb=6b7f04b45232e6c690cacf5815c85c39de1f52b3;p=helm.git diff --git a/helm/matita/matitaGui.ml b/helm/matita/matitaGui.ml index d50a2f319..9226ea7b6 100644 --- a/helm/matita/matitaGui.ml +++ b/helm/matita/matitaGui.ml @@ -64,9 +64,17 @@ class gui file = MatitaConsole.console ~evbox:main#consoleEventBox ~phrase_sep:";;" ~packing:main#scrolledConsole#add () in + let script_buf = script#scriptTextView#buffer in object (self) val mutable chosen_file = None + (** text mark and tag representing locked part of a script *) + val locked_mark = + script_buf#create_mark ~name:"locked" ~left_gravity:true + script_buf#start_iter + val locked_tag = + script_buf#create_tag [`BACKGROUND "green"; `EDITABLE false] + initializer (* glade's check widgets *) List.iter (fun w -> w#check_widgets ()) @@ -109,6 +117,7 @@ class gui file = | `CANCEL -> return None | `HELP -> () | `DELETE_EVENT -> return None)); + (* script *) (* menus *) List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem; main#saveAsMenuItem ]; @@ -184,6 +193,14 @@ class gui file = GtkThread.main (); !text + method lockScript offset = + let mark = `MARK locked_mark in + script_buf#move_mark mark ~where:(script_buf#get_iter_at_char offset); + script_buf#remove_tag locked_tag ~start:script_buf#start_iter + ~stop:script_buf#end_iter; + script_buf#apply_tag locked_tag ~start:script_buf#start_iter + ~stop:(script_buf#get_iter_at_mark mark) + end let instance =