Querying GtkTextView layout before display



I'm trying to implement margin images using GtkTextView (like img
align="left" in HTML).  My current approach is to create an HBox
containing the image as the first child and the text in a second
GtkTextView as the second child and insert this in an anchor.  I call
gtk_widget_set_size_request on the second GtkTextView to set its
height to be the same as the image and its width to the main
GtkTextView width less the width of the image.

But I need to determine how much text should go in the second
GtkTextView before spilling out into the main GtkTextView.  So I'm
adding characters and calling gtk_text_view_get_iter_location to see
when I've used up all the space in the GtkTextView.  But this function
claims that every character is on the first line of my GtkTextView and
it isn't performing word wrapping despite both text views having
GTK_WRAP_WORD.

Is there something I need to do to tell the GtkTextView to allocate
the iters to actual lines?  Is there a better approach?  Has someone
done this before?

Thanks.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]