How to use Gtk::Viewport in GTKMM4?
I have a large widget that I would like to fit into a small place and make it scrollable.
For this, I have an example code as follows. It creates a Gtk::Window
with default size 100×100, it has a Gtk::Box
that contains a Gtk::Viewport
and a Gtk::Scrollbar
. The Gtk::Viewport
widget contains a “large” widget with size 200×200. Unfortunately, the window grows to 200×200.
How to handle resize of Gtk::Window
Is there a way to handle Gtk::Window resize event? We don’t have an event controller for it, nor we can override Gtk::Widget::size_allocate
function because it’s not virtual.
How to fullscreen on the second monitor in GTKMM 4?
I have a window that extends Gtk::Window. I would like to go fullscreen on the second monitor using fullscreen_on_monitor(const Glib::RefPtr< Gdk::Monitor > &monitor). How do I get the second monitor?