1 (***********************************************************************)
3 (* MLTk, Tcl/Tk interface of Objective Caml *)
5 (* Francois Rouaix, Francois Pessaux, Jun Furuse and Pierre Weis *)
6 (* projet Cristal, INRIA Rocquencourt *)
7 (* Jacques Garrigue, Kyoto University RIMS *)
9 (* Copyright 2002 Institut National de Recherche en Informatique et *)
10 (* en Automatique and Kyoto University. All rights reserved. *)
11 (* This file is distributed under the terms of the GNU Library *)
12 (* General Public License, with the special exception on linking *)
13 (* described in file LICENSE found in the Objective Caml source tree. *)
15 (***********************************************************************)
20 let scroll_link sb tx =
21 Text.configure tx [YScrollCommand (Scrollbar.set sb)];
22 Scrollbar.configure sb [ScrollCommand (Text.yview tx)]
24 let f = Frame.create top []
25 let text = Text.create f []
26 let scrollbar = Scrollbar.create f []
32 Text.get text (TextIndex (Insert, []))
33 (TextIndex (Insert, [LineEnd]));
34 Text.delete text (TextIndex (Insert, []))
35 (TextIndex (Insert, [LineEnd]))
39 Text.insert text (TextIndex (Insert, [])) !buffer []
41 let _ = bind text [[Control], KeyPressDetail "y"] (BindSet ([], fun _ ->
44 let _ = bind text [[Control], KeyPressDetail "k"] (BindSet ([], fun _ ->
49 scroll_link scrollbar text;