Can I create mlti-row GtkNotebook?

Hi, ALL,
I need to create a properties dialog with 6 different suboptions, which will be displayed on 6 different panels of the notebook…
However the regular screen will not accommodate them and so I will have a little left/right buttons to scroll.
Is it possible to have a multi line notebook so everything will be displayed at once and user will not need to scroll left/right?

Than you.

Hi,

Why using a GtkNotebook for that?
(it’s intended for a dynamic number of tabs, instead of a fixed count like here)

Just use a GtkStack for storing the panels. You can get the panels list model with Gtk.Stack.get_pages , and then feed that model to widgets like GtkFlowBox or GtkGridView to generate the tabs.

That said, I would personally go for a simple GtkStackSidebar instead, when the horizontal space is too narrow.

@gwillems

I have many objects and they all have different number of options.
Notebook seems like the best choice, is it not?

Just use a GtkStack for storing the panels

Does GtkStack have the same UI as GtkNotebook? Namely display all pages at ones and let the user choose an arbitrary one?

Thank you.

No, it just shows the selected panel.
Additionally, you will need another widget to act as “header bar” to select the visible page. That “header bar” widget can be a GtkFlowBox or GtkGridView, as suggested. Both can be setup from a list model, so adding new pages to the GtkStack will automatically add a “tab” widget to the GtkFlowBox or GtkGridView.

@gwillems ,
Then its not what im looking for. User should be able to click on the arbitrary page at any given time and make changes.

The only problem is - if there are too many pages users will need to scroll to get to the one they need. Thats why i asked for multiline notebook.

But i guess its not supported. Sad.

Thank you.

P. S.: Actually some object have as little as 2 pages and some have ad much as 8. Thats why i thought that notebook is a perfect control for that. Except whole control is not visible at once…

Hmm… I’m not sure I understood what you mean by “multi-row notebook”.

Multiple tabs rows like notepad++ ? or something else?

A small sketch of the UI would help :slight_smile:

No, GtkNotebook does not work like that: it only allows a row of scrollable tabs, controlling the visible one.

You would need to re-implement GtkNotebook as a reflowing tab panel and a GtkStack.

@ebassi ,
Thx.

Ill just stick with the default one.

I presume this is what recommended by GTK UI guidelines, right?

Thank you.

There are no “GTK UI guidelines”, just what GTK looks like. Multi-line tabs have never been a thing in GTK.