How to fix that? Maybe I forgot some realizing method to update dimensions?
Sometimes it released without any issues, and sometimes with incorrect TextView height until I start enter some text or just grab the focus on this area.
That said, it should at least request the height of a single line I think…
I remember about a similar report in Gtk.TextView like row of Gtk.ListView does not expand (#635) · Issues · GNOME / pygobject · GitLab , seems that at init the textview doesn’t recompute its size by itself. It’s probably because textviews are usually placed in ScrolledWindows, so follow the allocated size instead of claiming it.
What happens if you call gtk_widget_queue_resize () on the textview? If it doesn’t help, then probably it’s just because it doesn’t have anything to display (some text or a cursor), so just stays flat.
grab_focus works here (even does not blinking until I click the area with mouse) thoughts maybe I can append some char to the buffer, then delete it…
UPD. only gtk_widget_set_size_request works, thank you
Yes, I was the one who created that topic. So far I haven’t found a good solution, the solution you suggested to me works in the minimum example I posted but doesn’t work in my general code. I ended up giving up on the app I was writing. The reason for giving up was not only this bug but it contributed a lot to it.
Thanks for the feedback. Sad to hear it did not worked
From my experience, scrollable widgets like TextView or TreeView only properly size when put as direct child of a ScrolledWindow.
Probably with vscrollbar-policy=NEVER and hscrollbar-policy=AUTOMATIC (mandatory for word-wrapping) for this kind of usecase.