Re: Add Gtk::TextView to Gtk::Grid

2022-10-06 Thread Bill Greene via gtkmm-list
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

Re: Add Gtk::TextView to Gtk::Grid

2022-10-06 Thread Kjell Ahlstedt via gtkmm-list
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

Re: Add Gtk::TextView to Gtk::Grid

2022-10-06 Thread Rodolfo Ribeiro Gomes via gtkmm-list
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

Re: Add Gtk::TextView to Gtk::Grid

2022-10-06 Thread Bill Greene via gtkmm-list
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

Re: Add Gtk::TextView to Gtk::Grid

2022-10-05 Thread Kjell Ahlstedt via gtkmm-list
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

Add Gtk::TextView to Gtk::Grid

2022-10-05 Thread Bill Greene via gtkmm-list
I am trying to add a TextView instance to a Grid. But when I display the window, it is empty. The Grid examples I have seen add buttons to the grid and these work fine for me. But I don't understand the difference between adding a button and adding a TextView. If anyone can help me with this, I wou