After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 102862 - Make scroll-to-iter magically work as expected
Make scroll-to-iter magically work as expected
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
unspecified
Other other
: Normal normal
: Small feature
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-01-09 07:37 UTC by kz
Modified: 2014-08-22 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gcc -o scroll_to_end scroll_to_end.c `pkg-config --libs --cflags gtk+-2.0` (1.01 KB, text/plain)
2003-02-06 12:33 UTC, kz
Details

Description kz 2003-01-08 17:36:08 UTC
Package: gtk+
Severity: minor
Version: 2.2.0
Synopsis: 'scroll to lastest iter' does not work properly
Bugzilla-Product: gtk+
Bugzilla-Component: GtkTextView

Description:
on change callback of text of buffer,
get the latest iter
and try to scroll to there; it fails.

if showcase is mentioned, I'll put a thing.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-01-08 12:36 -------

Reassigning to the default owner of the component, gtk-bugs@gtk.org.

Comment 1 Matthias Clasen 2003-01-14 10:59:07 UTC
Can you provide a small, self-contained testcase ?
Comment 2 kz 2003-02-06 12:33:23 UTC
Created attachment 14158 [details]
gcc -o scroll_to_end scroll_to_end.c `pkg-config --libs --cflags gtk+-2.0`
Comment 3 Owen Taylor 2003-05-24 17:38:20 UTC
This is a very, very, very, common GtkTextView FAQ

The problem is that when you tell it to scroll to an iter
right after you have inserted text, the size of the
text has not yet been calculated... it is zero size.

So, you need to use scroll-to-mark instead.

I've argued in the past that we should make scroll-to-iter
automatically do-the-right thing when called on a
not-fully-valid textview ... create a temporary mark,
scroll-to-mark that, and once things have settled
down, destroy the mark.
Comment 4 Matthias Clasen 2014-03-27 02:43:39 UTC
closing out ancient bugs
Comment 5 Sébastien Wilmet 2014-08-22 12:04:06 UTC
In gedit there are some places where scroll_to_mark must be called in an idle. For example after loading a file.

So it would be nice to make the API Just Work, either with scroll_to_iter or scroll_to_mark.