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 586998 - GtkAdjustment values do not correspond with the text view size
GtkAdjustment values do not correspond with the text view size
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.17.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-06-25 23:07 UTC by Nicolò Chieffo
Modified: 2018-02-10 03:39 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28



Description Nicolò Chieffo 2009-06-25 23:07:13 UTC
Please describe the problem:
In the GtkTextView help we can see that the position of the scrollbars is controlled by GtkAdjustment (I'm interested in vertical position), and "page_size" field represents the size of the visible scrollable area, while "upper" represents the most far point (which is the bottom of the text view if I understood).

Now see this piece of code:
the equivalent thing happens in C but I report it in C# because it is smaller.

Steps to reproduce:
[CODE SNIP]
1: textview1.SetBorderWindowSize(TextWindowType.Right, 30);
2: send = Gtk.Image.NewFromIconName("gtk-ok", IconSize.Menu);
3: textview1.AddChildInWindow(send, TextWindowType.Right, 0, 10);

4: scrolledwindow1.Vadjustment.Changed += delegate {
   4.1: Gtk.Adjustment adj = scrolledwindow1.Vadjustment;
   4.2: int value = (int) (adj.Upper - 16);
   4.3: textview1.MoveChild(send, 0, value);
};
[CODE SNIP END]

This is what it does:
1: sets a border in the text view right area
2: create a widget (an image from stock)
3: add the widget into the border, in position x=0 y=10 (bottom left of the border)

4: register to the changed signal, fired when the adjustment changes size (resized or lines added)
4.1: get the adjustment
4.2: calculate where to put the widget

Actual results:
I want it always in the bottom left of the border, because I've put it in the y=upper-16, which is the most far point minus the image height.

It correctly works well when resizing the text area, but not when I scroll

Expected results:
I would like that it works also when I scroll (actually when I scroll the image vanishes or is half displayed, I don't understand why

Does this happen every time?
yes

Other information:
Comment 1 Matthias Clasen 2018-02-10 03:39:55 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.