View titles and icon from GtkStackPage

With the command

g_object_set((GObject*)gtk_stack_get_page(GTK_STACK(stack),pbox),
                                                                        "title","first","icon-name","window-close",
                                                                        NULL);

I can put both icon and the title of GtkStackPage.

Unfortunately, I cannot find a method to display icon and title at the same time. Is there such a possibility at all?
Thank you for the help.

Gtk.StackPage itself only provides the information to the stack, it doesn’t render anything beside its child.

So, I guess you’re asking about Gtk.StackSwitcher. Unfortunately, it is designed to only show icon or label, with the icon taking precedent. However, it is possible to implement your own stack switcher which can show both, like libadwaita does with Adw.ViewSwitcher.

Have just looked in the source code. It is true.

Thank you!