Best practice for changing multiple pages / windows in general?

Hello guys. I’m new to the GTK or desktop apps development in general. I wonder what do you think is the best practice for an apps with multiple “pages” (terms stolen from webpage) / windows?

  • Should we use multiple Gtk.Window, and show / hide them?
  • Or just use one Gtk.Window and show / hide some container widgets?
  • One Gtk.Window and create / delete children?
  • Or something else…

I don’t know why & when I should use which approach. Any insights from experience is highly appreciated. Thanks beforehand.

Hi Immanuel, I think a GtkStack would be what you want. You can add each page to it and then show one page at a time, e.g. with set_visible_child_name. There also GtkStackSwitcher if want to always present a way to switch pages.


Hey @ihchristianto! The answer somewhat depends on what the pages are, how many of them there are, if there’s any structure to them, and so on.

I’m in the process of writing a new version of the HIG, which lays out some of the options: . Maybe that’s helpful?

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.