GNOME Bugzilla – Bug 586998
GtkAdjustment values do not correspond with the text view size
Last modified: 2018-02-10 03:39:55 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:
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.