GtkTextView documentation needs to be reviewed

View: New views
3 Messages — Rating Filter:   Alert me  

GtkTextView documentation needs to be reviewed

by Nicolò Chieffo-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

While I was reading the documentation of GtkTextView [1] I came up to
an "error". I moved to the section about
gtk_text_view_add_child_in_window [2] and read the help:
"..... a possible hack would be to update all child positions when the
scroll adjustments change or the text buffer changes. See bug 64518 on
bugzilla.gnome.org for status of fixing this issue."

I read the bug [3] which is marked as fix released, but it does not
seem to have anything to do with the problem which the documentation
was trying to expose.
(In fact I still haven't found a solution to this problem).

I would like to discuss about how changing the doc here. I can make my proposal:
".... a possible hack would be to connect to the signal 'changed'
and/or 'value-changed' of the GtkAdjustment, which you can obtain by
calling gtk_scrolled_window_get_vadjustment() on the parent window in
which the text view is. Then you will need to update the child
position using gtk_text_view_move_child() after having computed the
correct ypos (the GtkAdjustment can help)"

[1] http://library.gnome.org/devel/gtk/unstable/GtkTextView.html
[2] http://library.gnome.org/devel/gtk/unstable/GtkTextView.html#gtk-text-view-add-child-in-window
[3] http://bugzilla.gnome.org/show_bug.cgi?id=64518
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-devel-list

Re: GtkTextView documentation needs to be reviewed

by Owen Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 2009-07-05 at 14:34 +0200, Nicolò Chieffo wrote:

> While I was reading the documentation of GtkTextView [1] I came up to
> an "error". I moved to the section about
> gtk_text_view_add_child_in_window [2] and read the help:
> "..... a possible hack would be to update all child positions when the
> scroll adjustments change or the text buffer changes. See bug 64518 on
> bugzilla.gnome.org for status of fixing this issue."
>
> I read the bug [3] which is marked as fix released, but it does not
> seem to have anything to do with the problem which the documentation
> was trying to expose.
> (In fact I still haven't found a solution to this problem).
>
> I would like to discuss about how changing the doc here. I can make my proposal:
> ".... a possible hack would be to connect to the signal 'changed'
> and/or 'value-changed' of the GtkAdjustment, which you can obtain by
> calling gtk_scrolled_window_get_vadjustment() on the parent window in
> which the text view is. Then you will need to update the child
> position using gtk_text_view_move_child() after having computed the
> correct ypos (the GtkAdjustment can help)"

Why don't you think this problem is fixed?

- Owen


_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-devel-list

Re: GtkTextView documentation needs to be reviewed

by Nicolò Chieffo-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Jul 5, 2009 at 11:56 PM, Owen Taylor<otaylor@...> wrote:
> Why don't you think this problem is fixed?
>
> - Owen

In my opinion it's not fixed because of 2 things:
1) the doc explains the absence of an API to detect scrolling events,
and then cites bug number 64518 (which is marked fixed), but there's
still no scrolling API (except the GtkAdjustment workaround which is
the signals "changed" and "value-changed", to handle scrolling and
window resizes - the doc forgets to say that also when you resize you
have to move the child).
2) the GtkAdjustment workaround does not give correct results
(properties upper and value) whenever the scrolling bar appears [1]

There's currently no way to put a child in the border of a window and
keep aligned (for instance) on the bottom, except to use another
horrible workaround that I just discovered, which is to place the
child in GTK_TEXT_WINDOW_WIDGET (so it floadt over scrolling areas),
then add the window border, and move the child over the window border.
now since scrolling does not effect the child, this specific problem
is workarounded.
But if you are in another scenario in which the child should scroll
with the scrolling area (for instance if you want to keep an icon in
the right border aligned with the last line of text), if you use the
GtkAdjustment properties you will see that they return wrong values,
and if you base upon those results ypos in
gtk_text_view_move_child_in_window you won't get your child positioned
where you need.

If you need a code example I can give it.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=586998
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-devel-list