+ method chooseFile () =
+ fileSel#fileSelectionWin#show ();
+ GtkThread.main ();
+ chosen_file
+
+ method askText ?(title = "") ?(msg = "") () =
+ let dialog = new textDialog () in
+ dialog#textDialog#set_title title;
+ dialog#textDialogLabel#set_label msg;
+ let text = ref None in
+ let return v =
+ text := v;
+ dialog#textDialog#destroy ();
+ GMain.Main.quit ()
+ in
+ ignore (dialog#textDialog#event#connect#delete (fun _ -> true));
+ ignore (dialog#textDialogCancelButton#connect#clicked (fun _ ->
+ return None));
+ ignore (dialog#textDialogOkButton#connect#clicked (fun _ ->
+ let text = dialog#textDialogTextView#buffer#get_text () in
+ return (Some text)));
+ dialog#textDialog#show ();
+ 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)
+