Responsive Grid Example

Hi there,

I was wondering if there’s any good example for a responsive GTK grid. By responsive I mean it adjusts its contents based on the ancestor window width and height. To be more specific, I’m interested in listing 3 items per row (which are also grids themselves) when the window width >= 1280 and when it’s below that, 2 items per row listed.

I’m thinking about having separate grids (different layout, same content) and on every window resize action, based on the current size of the window, display the appropriate one. But I’m not sure if this is the ideal way of accomplishing this.

I use gtkmm but a gtk example would be good as well.

How you thought about using a Gtk::FlowBox instead of Gtk::Grid?

Thanks a lot, that’s exactly what I was looking for!