How to exclude particular area in GtkTextView in GTk3 c

, ,


I am working on the Gtk3 application in c, I wanted to add an image/ widget on top of a big paragraph like this, and the paragraph contents will wrap around the image accordingly to the visible area.

I tried to place the image with
gtk_text_view_add_child_in_window(GTK_TEXT_VIEW(textview), image, GTK_TEXT_WINDOW_TEXT, 0, 0);
But the contents of the TextView went under the image rather than wrapping around it.

So when we place the image/Widget/container on top of the TextView, is there any way where we can exclude that particular area so that, the text which should have been below the area of the overlapped image/Widget/container will come on the next visible area? is there any way to do this?

Thank You.

GtkTextView is not a full desktop publishing widget. What you want to achieve is not a supported use case.

1 Like

Thank you for the response, is there any other widget that can support my need?

Not inside GTK: that kind of reflowing text is very complicated, and typically application-specific. General purpose widgets can only get you so far.

You can try using HTML rendering and a WebKitWebView.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.