« Return to Thread: automatic text view scrolling

automatic text view scrolling

by Jacques Le Normand-2 :: Rate this Message:

Reply to Author | View in Thread

Hello gtk-devel,
I sent this question to the wrong list before, sorry about that. I've
created a text view in a scrolled window and I'd like my scrolled window to
automatically scroll whenever the cursor goes offscreen.
Here's my code(in ocaml)

open Gobject
let _ =
  let source_window = GWindow.window () in
  let scrolled_window = GBin.scrolled_window ~packing:source_window#add ()
in
  let buffer = GText.buffer () in
  let view = GText.view ~buffer:buffer ~packing:scrolled_window#add  () in
    buffer#insert "santo\nsanto\nsanto\nsanto
\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nsanto\nnot\n";
    buffer#place_cursor (buffer#get_iter (`OFFSET 500));
    source_window#show ();
    source_window#maximize ();
    GMain.Main.main ()



how can this be done?
cheers
--Jacques
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

 « Return to Thread: automatic text view scrolling