It would be good to have a popup menu check box to wrap lines.
There is a [wrap](https://docs.gtk.org/gtk3/property.CellRendererText.wrap-mode.html) property to render treeview lines, but I can't get that to work. Here's my branch: https://github.com/ntrel/geany/commits/msgwin-wrap/
Even if you call `g_object_set` when the cell renderer is created, it still doesn't work because of a GTK bug: https://stackoverflow.com/questions/17597043/gtk-cellrenderertext-makes-itse...
It was closed as won't fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/12
Apparently it is possible to do - python code, not tested: https://github.com/kennydude/reference-cat/commit/af79b567f6a63cf9416c14812b...
According to the GTK wrap-mode link in your OP the `wrap-width` property also needs to be set as well, its not in your WIP commit so unless its already set somewhere else in Geany it needs to be added.
Note the Python code sets `wrap-width`.
@elextr No, it's in the WIP commit.
g_object_set(cell_renderers[type], "wrap-mode", PANGO_WRAP_WORD,
"wrap-width", set ? 30 : -1, NULL);
The python tree view callback didn't work.
I had a short time to try things.
Based on your status window code, set `wrap-mode` and `wrap-width` (which is pixels not characters).
Testing with status window on the right so the width can be changed with the pane separator sees wrapping happen fine at the set `wrap-width` or the window width if it is _greater_ than `wrap-width`. So `wrap-width` sets the _minimum_ wrap width in pixels, if less space is available it simply hides part of the column like normal.
But row heights are not recalculated, it is calculated when data is first added to the row and left at the height needed for `wrap-width` since this is big enough to contain the worst case. That is why various examples on the web show massive blank space when `wrap-width` was set small (like 50 in one example) and so the row height was calculated based on that value but he text wrapped based on the actual widget width.
Your attempt to use the callback to reset `wrap-width` seemed a good idea, but for me it is never called with signal `check-resize` (printf debugging :-). Maybe another signal could work better?
Alternatively given the uses it should be enough if we can calculate the right value for `wrap-width` based on the layout and just leave it since none of the message windows change their existing contents and new lines added (eg in status) get their height based on the `wrap-width`. This won't change the height if the window is resized after it has content, but that won't matter so much for compiler and messages which are reset regularly, so long as the new `wrap-width` is used when the new data is added. With this model status probably should be left unwrapped and of course its irrelevant to scribble and terminal.
I have run out of time now, over to you.
github-comments@lists.geany.org