GtkButtonBox in GTK4

How can I replace GtkButtonBox in GTK4?

When trying GtkBox, it show buttons separately, not merged together

Imgur

Hi,

For “merging” buttons, set the linked style to the box:

gtk_widget_add_css_class (mybox, "linked");
1 Like

You want to use another box, with a linked CSS class:

Box
+---- Button (icon="home")
+---- Box (css_class="linked")
      +---- Button (icon="backward")
      +---- Button (icon="forward")
+---- Button (icon="refresh")

See the libadwaita style classes docs.

1 Like

Thanks much, works!

add_css_class("linked") in c++/gtkmm

1 Like

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