automatic text view scrolling
- From: "Jacques Le Normand" <rathereasy gmail com>
- To: gtk-app-devel-list gnome org
- Subject: automatic text view scrolling
- Date: Thu, 15 May 2008 15:39:51 -0400
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]