placing a cursor and scrolling automatically
- Date: Thu, 15 May 2008 15:21:06 -0400
- From: "Jacques Le Normand" <rathereasy@xxxxxxxxx>
- Subject: placing a cursor and scrolling automatically
Hello gtk-devel,
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-devel-list mailing list gtk-devel-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-devel-list
- Prev by Date: Re: Minutes of the GTK+ Team IRC meeting - 2008-05-13
- Next by Date: Re: Integrating optional file chooser implementations into GTK+
- Previous by thread: Gdk patch review request
- Next by thread: Help newbie with gtk+ patch
- Index(es):