Many thanks! It seems that the following call was the key to my problem:
m_TextView.set_expand();
This call seems very non-intuitive to me; I would have expected the
TextView to automatically expand
based on the contents of the TextBuffer.
Or, to ask the question another way: Why does the TextView
set_child(m_grid); shows that this is gtkmm4.
I made some tests with the TextView example in gtkmm-documentation,
https://gitlab.gnome.org/GNOME/gtkmm-documentation/-/tree/master/examples/book/textview
1. Replaced Gtk::Box m_VBox; by Gtk::Grid m_grid; The TextView is a
child of a ScrolledWindo
If you are gtkmm3, widgets are hidden by default.
You should call Gtk::Container::show_all_children() or
Gtk::Widget::show_all().
AFAIK, in gtkmm4 this isn't necessary anymore, as widgets are (finally)
visible by default.
Em qui., 6 de out. de 2022 às 07:33, Bill Greene via gtkmm-list <
gtkmm-lis
Thanks for taking a look at this.
Unfortunately, even after I make the TextView a class member, I still
don't see the text displayed in the window.
A concise description of the problem is this:
If I make the TextView a child of the window, the text is displayed. If I
make the TextView a child of
You have declared the TextView as a local variable in the constructor.
It will be deleted when the constructor finishes. You must either
declared it in your window class, like the buttons in
https://gitlab.gnome.org/GNOME/gtkmm-documentation/-/blob/master/examples/book/grid/examplewindow.h
or