Notebook widget alternatives (with tab close button)

I’m working on simple GTK web browser and looking for page tabs widget. Currently, I found only one candidate - it’s Notebook.

But there is no tab close buttons and it looks like good widget maybe for static sections only, like application settings or so.

Maybe some another alternative available from the GTK collection? Or maybe some CSS class available to change it view options.

1 Like

GTK doesn’t have that built-in. There’s AdwTabView if you’re working with libadwaita, otherwise you’ll likely have to partially roll the widgetry yourself.

See Reinventing tabs – Just another blog for more info.

1 Like

Hi,

If you can’t use libadwaita, an easy way to implement tabs is to use an horizontal GtkListView.
You can use a GtkStack pages list as model, and setup a factory to generate the tabs from the page’s properties (title, icon, …), with whatever extra widgets you want (close button, …)

2 Likes

Useful article, thanks advice!

Does libhandy officially provide any wrapper for C++ like gtkmm?